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

This commit is contained in:
Ilya Laktyushin
2020-07-15 12:59:21 +03:00
40 changed files with 231 additions and 4666 deletions

View File

@@ -1111,13 +1111,13 @@ public final class AccountViewTracker {
let combinedDisposable = MetaDisposable()
self.queue.async {
var addHole = false
if let context = self.channelPollingContexts[peerId] {
/*if let context = self.channelPollingContexts[peerId] {
if context.subscribers.isEmpty {
addHole = true
}
} else {
addHole = true
}
}*/
if addHole {
let _ = self.account?.postbox.transaction({ transaction -> Void in
if transaction.getPeerChatListIndex(peerId) == nil {

View File

@@ -218,7 +218,7 @@ private func parseConnectionSet(primary: Api.PhoneConnection, alternative: [Api.
private final class CallSessionContext {
let peerId: PeerId
let isOutgoing: Bool
let type: CallSession.CallType
var type: CallSession.CallType
var state: CallSessionInternalState
let subscribers = Bag<(CallSession) -> Void>()
let signalingSubscribers = Bag<(Data) -> Void>()
@@ -576,6 +576,12 @@ private final class CallSessionManagerContext {
}
}
func updateCallType(internalId: CallSessionInternalId, type: CallSession.CallType) {
if let context = self.contexts[internalId] {
context.type = type
}
}
func updateSession(_ call: Api.PhoneCall, completion: @escaping ((CallSessionRingingState, CallSession)?) -> Void) {
var resultRingingState: (CallSessionRingingState, CallSession)?
@@ -932,6 +938,12 @@ public final class CallSessionManager {
}
}
public func updateCallType(internalId: CallSessionInternalId, type: CallSession.CallType) {
self.withContext { context in
context.updateCallType(internalId: internalId, type: type)
}
}
public func updateVersions(versions: [String]) {
self.withContext { context in
context.updateVersions(versions: versions)