@@ -2168,12 +2168,19 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
21682168
21692169 let phoneNumber = payloadJson [ " phoneNumber " ] as? String
21702170
2171- if let fromIdString = payloadJson [ " from_id " ] as? String , let fromId = Int64 ( fromIdString) , let groupCallIdString = payloadJson [ " group_call_id " ] as? String , let groupCallId = Int64 ( groupCallIdString) , let messageIdString = payloadJson [ " msg_id " ] as? String , let messageId = Int32 ( messageIdString) , let isVideoString = payloadJson [ " video " ] as? String , let isVideo = Int32 ( isVideoString ) , let fromTitle = payloadJson [ " from_title " ] as? String {
2171+ if let fromIdString = payloadJson [ " from_id " ] as? String , let fromId = Int64 ( fromIdString) , let groupCallIdString = payloadJson [ " group_call_id " ] as? String , let groupCallId = Int64 ( groupCallIdString) , let messageIdString = payloadJson [ " msg_id " ] as? String , let messageId = Int32 ( messageIdString) , let fromTitle = payloadJson [ " from_title " ] as? String {
21722172 guard let callKitIntegration = CallKitIntegration . shared else {
21732173 Logger . shared. log ( " App \( self . episodeId) PushRegistry " , " CallKitIntegration is not available " )
21742174 completion ( )
21752175 return
21762176 }
2177+
2178+ var isVideo = false
2179+ if let isVideoString = payloadJson [ " video " ] as? String , let isVideoValue = Int32 ( isVideoString) {
2180+ isVideo = isVideoValue != 0
2181+ } else if let isVideoString = payloadJson [ " video " ] as? String , let isVideoValue = Bool ( isVideoString) {
2182+ isVideo = isVideoValue
2183+ }
21772184
21782185 let fromPeerId = PeerId ( namespace: Namespaces . Peer. CloudUser, id: PeerId . Id. _internalFromInt64Value ( fromId) )
21792186 let messageId = MessageId ( peerId: fromPeerId, namespace: Namespaces . Message. Cloud, id: messageId)
@@ -2199,7 +2206,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
21992206 stableId: groupCallId,
22002207 handle: " \( fromPeerId. id. _internalGetInt64Value ( ) ) " ,
22012208 phoneNumber: phoneNumber. flatMap ( formatPhoneNumber) ,
2202- isVideo: isVideo != 0 ,
2209+ isVideo: isVideo,
22032210 displayTitle: displayTitle,
22042211 completion: { error in
22052212 if let error = error {
@@ -2226,7 +2233,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
22262233 var processed = false
22272234 for (_, context, _) in activeAccounts. accounts {
22282235 if context. account. id == accountId {
2229- context. account. callSessionManager. addConferenceInvitationMessages ( ids: [ ( messageId, IncomingConferenceTermporaryExternalInfo ( callId: groupCallId, isVideo: isVideo != 0 ) ) ] )
2236+ context. account. callSessionManager. addConferenceInvitationMessages ( ids: [ ( messageId, IncomingConferenceTermporaryExternalInfo ( callId: groupCallId, isVideo: isVideo) ) ] )
22302237
22312238 /*disposable.set((context.account.callSessionManager.callState(internalId: internalId)
22322239 |> deliverOnMainQueue).start(next: { state in
0 commit comments