Fix conference

This commit is contained in:
Isaac 2025-04-17 20:04:24 +04:00
parent c1f9068c11
commit 56058e73f0
2 changed files with 11 additions and 4 deletions

View File

@ -1298,7 +1298,7 @@ private final class NotificationServiceHandler {
var voipPayload: [AnyHashable: Any] = [
"group_call_id": "\(groupCallData.id)",
"msg_id": "\(groupCallData.messageId)",
"video": "\(groupCallData.isVideo)",
"video": "\(groupCallData.isVideo ? 1 : 0)",
"member_count": "\(groupCallData.memberCount)",
"from_id": "\(groupCallData.fromId.id._internalGetInt64Value())",
"from_title": groupCallData.fromTitle,

View File

@ -2168,13 +2168,20 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
let phoneNumber = payloadJson["phoneNumber"] as? String
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 {
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 {
guard let callKitIntegration = CallKitIntegration.shared else {
Logger.shared.log("App \(self.episodeId) PushRegistry", "CallKitIntegration is not available")
completion()
return
}
var isVideo = false
if let isVideoString = payloadJson["video"] as? String, let isVideoValue = Int32(isVideoString) {
isVideo = isVideoValue != 0
} else if let isVideoString = payloadJson["video"] as? String, let isVideoValue = Bool(isVideoString) {
isVideo = isVideoValue
}
let fromPeerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(fromId))
let messageId = MessageId(peerId: fromPeerId, namespace: Namespaces.Message.Cloud, id: messageId)
@ -2199,7 +2206,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
stableId: groupCallId,
handle: "\(fromPeerId.id._internalGetInt64Value())",
phoneNumber: phoneNumber.flatMap(formatPhoneNumber),
isVideo: isVideo != 0,
isVideo: isVideo,
displayTitle: displayTitle,
completion: { error in
if let error = error {
@ -2226,7 +2233,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
var processed = false
for (_, context, _) in activeAccounts.accounts {
if context.account.id == accountId {
context.account.callSessionManager.addConferenceInvitationMessages(ids: [(messageId, IncomingConferenceTermporaryExternalInfo(callId: groupCallId, isVideo: isVideo != 0))])
context.account.callSessionManager.addConferenceInvitationMessages(ids: [(messageId, IncomingConferenceTermporaryExternalInfo(callId: groupCallId, isVideo: isVideo))])
/*disposable.set((context.account.callSessionManager.callState(internalId: internalId)
|> deliverOnMainQueue).start(next: { state in