Skip to content

Commit 239862c

Browse files
author
Isaac
committed
Fix conference
(cherry picked from commit 56058e7)
1 parent caeef02 commit 239862c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Telegram/NotificationService/Sources/NotificationService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ private final class NotificationServiceHandler {
12981298
var voipPayload: [AnyHashable: Any] = [
12991299
"group_call_id": "\(groupCallData.id)",
13001300
"msg_id": "\(groupCallData.messageId)",
1301-
"video": "\(groupCallData.isVideo)",
1301+
"video": "\(groupCallData.isVideo ? 1 : 0)",
13021302
"member_count": "\(groupCallData.memberCount)",
13031303
"from_id": "\(groupCallData.fromId.id._internalGetInt64Value())",
13041304
"from_title": groupCallData.fromTitle,

submodules/TelegramUI/Sources/AppDelegate.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)