diff --git a/Telegram-iOS/AppDelegate.swift b/Telegram-iOS/AppDelegate.swift index 1ec7607b13..4b236acf9e 100644 --- a/Telegram-iOS/AppDelegate.swift +++ b/Telegram-iOS/AppDelegate.swift @@ -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 { diff --git a/submodules/LegacyComponents b/submodules/LegacyComponents index 94aadbb5b7..834e3a865d 160000 --- a/submodules/LegacyComponents +++ b/submodules/LegacyComponents @@ -1 +1 @@ -Subproject commit 94aadbb5b721763afb1f15b60f38e7624c625588 +Subproject commit 834e3a865deb0bad47c54094792044aef450c910 diff --git a/submodules/TelegramCore b/submodules/TelegramCore index ac166d7b61..99e75d0f2d 160000 --- a/submodules/TelegramCore +++ b/submodules/TelegramCore @@ -1 +1 @@ -Subproject commit ac166d7b6106fa9e0400d7175d38cc679b6c4f31 +Subproject commit 99e75d0f2dc4f76deff6689ff9dd6b848b8312e9 diff --git a/submodules/TelegramUI b/submodules/TelegramUI index ea4b62939b..3302f0ab4f 160000 --- a/submodules/TelegramUI +++ b/submodules/TelegramUI @@ -1 +1 @@ -Subproject commit ea4b62939b3390f98c24cabeef42956d02a4e706 +Subproject commit 3302f0ab4fe7497c79b43befe665efd3e3e5cb40