mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Add voice chat invite links support
This commit is contained in:
@@ -624,9 +624,15 @@ public final class PresentationCallManagerImpl: PresentationCallManager {
|
||||
}
|
||||
}
|
||||
|
||||
public func joinGroupCall(context: AccountContext, peerId: PeerId, joinAsPeerId: PeerId?, initialCall: CachedChannelData.ActiveCall, endCurrentIfAny: Bool) -> JoinGroupCallManagerResult {
|
||||
public func joinGroupCall(context: AccountContext, peerId: PeerId, invite: String?, requestJoinAsPeerId: ((@escaping (PeerId?) -> Void) -> Void)?, initialCall: CachedChannelData.ActiveCall, endCurrentIfAny: Bool) -> JoinGroupCallManagerResult {
|
||||
let begin: () -> Void = { [weak self] in
|
||||
let _ = self?.startGroupCall(accountContext: context, peerId: peerId, joinAsPeerId: joinAsPeerId, initialCall: initialCall).start()
|
||||
if let requestJoinAsPeerId = requestJoinAsPeerId {
|
||||
requestJoinAsPeerId({ joinAsPeerId in
|
||||
let _ = self?.startGroupCall(accountContext: context, peerId: peerId, invite: invite, joinAsPeerId: joinAsPeerId, initialCall: initialCall).start()
|
||||
})
|
||||
} else {
|
||||
let _ = self?.startGroupCall(accountContext: context, peerId: peerId, invite: invite, joinAsPeerId: nil, initialCall: initialCall).start()
|
||||
}
|
||||
}
|
||||
|
||||
if let currentGroupCall = self.currentGroupCallValue {
|
||||
@@ -660,6 +666,7 @@ public final class PresentationCallManagerImpl: PresentationCallManager {
|
||||
private func startGroupCall(
|
||||
accountContext: AccountContext,
|
||||
peerId: PeerId,
|
||||
invite: String?,
|
||||
joinAsPeerId: PeerId?,
|
||||
initialCall: CachedChannelData.ActiveCall,
|
||||
internalId: CallSessionInternalId = CallSessionInternalId()
|
||||
@@ -711,6 +718,7 @@ public final class PresentationCallManagerImpl: PresentationCallManager {
|
||||
initialCall: initialCall,
|
||||
internalId: internalId,
|
||||
peerId: peerId,
|
||||
invite: invite,
|
||||
joinAsPeerId: joinAsPeerId
|
||||
)
|
||||
strongSelf.updateCurrentGroupCall(call)
|
||||
|
||||
Reference in New Issue
Block a user