mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix conference
(cherry picked from commit 56058e73f05318c5a46c959a8841519e078027f9)
This commit is contained in:
parent
caeef02be3
commit
239862cae2
@ -1298,7 +1298,7 @@ private final class NotificationServiceHandler {
|
|||||||
var voipPayload: [AnyHashable: Any] = [
|
var voipPayload: [AnyHashable: Any] = [
|
||||||
"group_call_id": "\(groupCallData.id)",
|
"group_call_id": "\(groupCallData.id)",
|
||||||
"msg_id": "\(groupCallData.messageId)",
|
"msg_id": "\(groupCallData.messageId)",
|
||||||
"video": "\(groupCallData.isVideo)",
|
"video": "\(groupCallData.isVideo ? 1 : 0)",
|
||||||
"member_count": "\(groupCallData.memberCount)",
|
"member_count": "\(groupCallData.memberCount)",
|
||||||
"from_id": "\(groupCallData.fromId.id._internalGetInt64Value())",
|
"from_id": "\(groupCallData.fromId.id._internalGetInt64Value())",
|
||||||
"from_title": groupCallData.fromTitle,
|
"from_title": groupCallData.fromTitle,
|
||||||
|
@ -2168,12 +2168,19 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
|||||||
|
|
||||||
let phoneNumber = payloadJson["phoneNumber"] as? String
|
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 {
|
guard let callKitIntegration = CallKitIntegration.shared else {
|
||||||
Logger.shared.log("App \(self.episodeId) PushRegistry", "CallKitIntegration is not available")
|
Logger.shared.log("App \(self.episodeId) PushRegistry", "CallKitIntegration is not available")
|
||||||
completion()
|
completion()
|
||||||
return
|
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 fromPeerId = PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(fromId))
|
||||||
let messageId = MessageId(peerId: fromPeerId, namespace: Namespaces.Message.Cloud, id: messageId)
|
let messageId = MessageId(peerId: fromPeerId, namespace: Namespaces.Message.Cloud, id: messageId)
|
||||||
@ -2199,7 +2206,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
|||||||
stableId: groupCallId,
|
stableId: groupCallId,
|
||||||
handle: "\(fromPeerId.id._internalGetInt64Value())",
|
handle: "\(fromPeerId.id._internalGetInt64Value())",
|
||||||
phoneNumber: phoneNumber.flatMap(formatPhoneNumber),
|
phoneNumber: phoneNumber.flatMap(formatPhoneNumber),
|
||||||
isVideo: isVideo != 0,
|
isVideo: isVideo,
|
||||||
displayTitle: displayTitle,
|
displayTitle: displayTitle,
|
||||||
completion: { error in
|
completion: { error in
|
||||||
if let error = error {
|
if let error = error {
|
||||||
@ -2226,7 +2233,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
|
|||||||
var processed = false
|
var processed = false
|
||||||
for (_, context, _) in activeAccounts.accounts {
|
for (_, context, _) in activeAccounts.accounts {
|
||||||
if context.account.id == accountId {
|
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)
|
/*disposable.set((context.account.callSessionManager.callState(internalId: internalId)
|
||||||
|> deliverOnMainQueue).start(next: { state in
|
|> deliverOnMainQueue).start(next: { state in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user