mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-06 17:00:13 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
a0bd50a0f6
2
.gitmodules
vendored
2
.gitmodules
vendored
@ -9,7 +9,7 @@ url=../Display.git
|
||||
url = git@github.com:peter-iakovlev/HockeySDK-iOS.git
|
||||
[submodule "submodules/libtgvoip"]
|
||||
path = submodules/libtgvoip
|
||||
url=git@github.com:grishka/libtgvoip.git
|
||||
url=git@github.com:peter-iakovlev/libtgvoip.git
|
||||
[submodule "submodules/lottie-ios"]
|
||||
path = submodules/lottie-ios
|
||||
url=git@github.com:peter-iakovlev/lottie-ios.git
|
||||
|
||||
@ -639,10 +639,33 @@ private enum QueuedWakeup: Int32 {
|
||||
|
||||
self.contextDisposable.set(self.context.get().start(next: { context in
|
||||
assert(Queue.mainQueue().isCurrent())
|
||||
Logger.shared.log("App \(self.episodeId)", "received context \(String(describing: context)) account \(String(describing: context?.accountId))")
|
||||
var network: Network?
|
||||
if let context = context {
|
||||
switch context {
|
||||
case let .unauthorized(unauthorized):
|
||||
network = unauthorized.account.network
|
||||
case let .authorized(authorized):
|
||||
network = authorized.account.network
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Logger.shared.log("App \(self.episodeId)", "received context \(String(describing: context)) account \(String(describing: context?.accountId)) network \(String(describing: network))")
|
||||
|
||||
if let contextValue = self.contextValue {
|
||||
(contextValue.account?.applicationContext as? TelegramApplicationContext)?.isCurrent = false
|
||||
switch contextValue {
|
||||
case let .unauthorized(unauthorized):
|
||||
unauthorized.account.shouldBeServiceTaskMaster.set(.single(.never))
|
||||
case let .authorized(authorized):
|
||||
authorized.account.shouldBeServiceTaskMaster.set(.single(.never))
|
||||
authorized.account.shouldKeepOnlinePresence.set(.single(false))
|
||||
authorized.account.shouldExplicitelyKeepWorkerConnections.set(.single(false))
|
||||
authorized.account.shouldKeepBackgroundDownloadConnections.set(.single(false))
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
self.contextValue = context
|
||||
if let context = context {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user