Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin 2018-12-19 19:43:19 +04:00
commit a0bd50a0f6
2 changed files with 25 additions and 2 deletions

2
.gitmodules vendored
View File

@ -9,7 +9,7 @@ url=../Display.git
url = git@github.com:peter-iakovlev/HockeySDK-iOS.git url = git@github.com:peter-iakovlev/HockeySDK-iOS.git
[submodule "submodules/libtgvoip"] [submodule "submodules/libtgvoip"]
path = submodules/libtgvoip path = submodules/libtgvoip
url=git@github.com:grishka/libtgvoip.git url=git@github.com:peter-iakovlev/libtgvoip.git
[submodule "submodules/lottie-ios"] [submodule "submodules/lottie-ios"]
path = submodules/lottie-ios path = submodules/lottie-ios
url=git@github.com:peter-iakovlev/lottie-ios.git url=git@github.com:peter-iakovlev/lottie-ios.git

View File

@ -639,10 +639,33 @@ private enum QueuedWakeup: Int32 {
self.contextDisposable.set(self.context.get().start(next: { context in self.contextDisposable.set(self.context.get().start(next: { context in
assert(Queue.mainQueue().isCurrent()) 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 { if let contextValue = self.contextValue {
(contextValue.account?.applicationContext as? TelegramApplicationContext)?.isCurrent = false (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 self.contextValue = context
if let context = context { if let context = context {