Group chats update

This commit is contained in:
Ali
2020-11-17 20:31:25 +04:00
parent 0e3445983c
commit 4336fa0d05
39 changed files with 1038 additions and 2316 deletions

View File

@@ -592,18 +592,16 @@ public final class PresentationCallManagerImpl: PresentationCallManager {
}
}
public func requestOrJoinGroupCall(context: AccountContext, peerId: PeerId) {
let begin: () -> Void = { [weak self] in
guard let strongSelf = self else {
return
}
let _ = strongSelf.startGroupCall(account: context.account, peerId: peerId).start()
public func requestOrJoinGroupCall(context: AccountContext, peerId: PeerId) -> RequestOrJoinGroupCallResult {
if let currentGroupCall = self.currentGroupCallValue {
return .alreadyInProgress(currentGroupCall.peerId)
}
begin()
let _ = self.startGroupCall(accountContext: context, peerId: peerId).start()
return .requested
}
private func startGroupCall(
account: Account,
accountContext: AccountContext,
peerId: PeerId,
internalId: CallSessionInternalId = CallSessionInternalId()
) -> Signal<Bool, NoError> {
@@ -647,7 +645,7 @@ public final class PresentationCallManagerImpl: PresentationCallManager {
}
let call = PresentationGroupCallImpl(
account: account,
accountContext: accountContext,
audioSession: strongSelf.audioSession,
callKitIntegration: nil,
getDeviceAccessData: strongSelf.getDeviceAccessData,
@@ -658,7 +656,7 @@ public final class PresentationCallManagerImpl: PresentationCallManager {
strongSelf.updateCurrentGroupCall(call)
strongSelf.currentGroupCallPromise.set(.single(call))
strongSelf.hasActiveCallsPromise.set(true)
strongSelf.removeCurrentCallDisposable.set((call.canBeRemoved.get()
strongSelf.removeCurrentCallDisposable.set((call.canBeRemoved
|> deliverOnMainQueue).start(next: { [weak call] value in
if value, let strongSelf = self, let call = call {
if strongSelf.currentGroupCall === call {