From 7ed25d43f19db24fdafe5ec224c74fd854d5fdb5 Mon Sep 17 00:00:00 2001 From: overtake Date: Fri, 18 Dec 2020 16:19:22 +0400 Subject: [PATCH] webrtc mac specific fix + return exported link [skip ci] --- .../TelegramCore/Sources/InvitationLinks.swift | 18 ++++++++++++------ third-party/webrtc/webrtc-ios | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/submodules/TelegramCore/Sources/InvitationLinks.swift b/submodules/TelegramCore/Sources/InvitationLinks.swift index 516ba47d0b..00de49bdd1 100644 --- a/submodules/TelegramCore/Sources/InvitationLinks.swift +++ b/submodules/TelegramCore/Sources/InvitationLinks.swift @@ -6,8 +6,8 @@ import MtProtoKit import SyncCore -public func ensuredExistingPeerExportedInvitation(account: Account, peerId: PeerId, revokeExisted: Bool = false) -> Signal { - return account.postbox.transaction { transaction -> Signal in +public func ensuredExistingPeerExportedInvitation(account: Account, peerId: PeerId, revokeExisted: Bool = false) -> Signal { + return account.postbox.transaction { transaction -> Signal in if let peer = transaction.getPeer(peerId), let inputPeer = apiInputPeer(peer) { if let _ = peer as? TelegramChannel { if let cachedData = transaction.getPeerCachedData(peerId: peerId) as? CachedChannelData, cachedData.exportedInvitation != nil && !revokeExisted { @@ -15,8 +15,8 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer } else { return account.network.request(Api.functions.messages.exportChatInvite(peer: inputPeer)) |> retryRequest - |> mapToSignal { result -> Signal in - return account.postbox.transaction { transaction -> Void in + |> mapToSignal { result -> Signal in + return account.postbox.transaction { transaction -> String? in if let invitation = ExportedInvitation(apiExportedInvite: result) { transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in if let current = current as? CachedChannelData { @@ -25,6 +25,9 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer return CachedChannelData().withUpdatedExportedInvitation(invitation) } }) + return invitation.link + } else { + return nil } } } @@ -35,8 +38,8 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer } else { return account.network.request(Api.functions.messages.exportChatInvite(peer: inputPeer)) |> retryRequest - |> mapToSignal { result -> Signal in - return account.postbox.transaction { transaction -> Void in + |> mapToSignal { result -> Signal in + return account.postbox.transaction { transaction -> String? in if let invitation = ExportedInvitation(apiExportedInvite: result) { transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in if let current = current as? CachedGroupData { @@ -45,6 +48,9 @@ public func ensuredExistingPeerExportedInvitation(account: Account, peerId: Peer return current } }) + return invitation.link + } else { + return nil } } } diff --git a/third-party/webrtc/webrtc-ios b/third-party/webrtc/webrtc-ios index 982b3456d0..15ce8b1b99 160000 --- a/third-party/webrtc/webrtc-ios +++ b/third-party/webrtc/webrtc-ios @@ -1 +1 @@ -Subproject commit 982b3456d0b18369f36e2b1e1438f40235a12eae +Subproject commit 15ce8b1b99dce2d1404f21f9e974f564bdbf4165