From 84ad1344c7e009dd0f40a94696d4fdff429115f5 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Thu, 10 Apr 2025 19:56:53 +0400 Subject: [PATCH] Confrence updates --- .../Sources/CallListControllerNode.swift | 4 +-- .../Sources/PresentationGroupCall.swift | 25 ++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/submodules/CallListUI/Sources/CallListControllerNode.swift b/submodules/CallListUI/Sources/CallListControllerNode.swift index 74b1c7280a..204dffbf3f 100644 --- a/submodules/CallListUI/Sources/CallListControllerNode.swift +++ b/submodules/CallListUI/Sources/CallListControllerNode.swift @@ -126,7 +126,7 @@ private func mappedInsertEntries(context: AccountContext, presentationData: Item case let .displayTabInfo(_, text): return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: 0), directionHint: entry.directionHint) case .openNewCall: - let item = ItemListPeerActionItem(presentationData: presentationData, style: showSettings ? .blocks : .plain, icon: .none, title: presentationData.strings.CallList_NewCall, hasSeparator: false, sectionId: 1, height: .generic, noInsets: true, editing: false, action: { + let item = ItemListPeerActionItem(presentationData: presentationData, style: showSettings ? .blocks : .plain, icon: PresentationResourcesRootController.navigationCallIcon(presentationData.theme), title: presentationData.strings.CallList_NewCall, hasSeparator: false, sectionId: 1, height: .generic, noInsets: true, editing: false, action: { nodeInteraction.openNewCall() }) return ListViewInsertItem(index: entry.index, previousIndex: entry.previousIndex, item: item, directionHint: entry.directionHint) @@ -150,7 +150,7 @@ private func mappedUpdateEntries(context: AccountContext, presentationData: Item case let .displayTabInfo(_, text): return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: ItemListTextItem(presentationData: presentationData, text: .plain(text), sectionId: 0), directionHint: entry.directionHint) case .openNewCall: - let item = ItemListPeerActionItem(presentationData: presentationData, icon: .none, title: presentationData.strings.CallList_NewCall, sectionId: 1, height: .generic, noInsets: true, editing: false, action: { + let item = ItemListPeerActionItem(presentationData: presentationData, style: showSettings ? .blocks : .plain, icon: PresentationResourcesRootController.navigationCallIcon(presentationData.theme), title: presentationData.strings.CallList_NewCall, hasSeparator: false, sectionId: 1, height: .generic, noInsets: true, editing: false, action: { nodeInteraction.openNewCall() }) return ListViewUpdateItem(index: entry.index, previousIndex: entry.previousIndex, item: item, directionHint: entry.directionHint) diff --git a/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift b/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift index 781dda7de0..bb7957c770 100644 --- a/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift +++ b/submodules/TelegramCallsUI/Sources/PresentationGroupCall.swift @@ -859,6 +859,12 @@ public final class PresentationGroupCallImpl: PresentationGroupCall { self.isConference = isConference self.beginWithVideo = beginWithVideo self.keyPair = keyPair + + if self.isConference && conferenceSourceId == nil { + self.isMutedValue = .unmuted + self.isMutedPromise.set(self.isMutedValue) + self.stateValue.muteState = nil + } if let keyPair, let initialCall { self.e2eContext = ConferenceCallE2EContext( @@ -1760,6 +1766,15 @@ public final class PresentationGroupCallImpl: PresentationGroupCall { self.onMutedSpeechActivityDetected?(value) } }, isConference: self.isConference, audioIsActiveByDefault: audioIsActiveByDefault, isStream: self.isStream, sharedAudioDevice: self.sharedAudioContext?.audioDevice, encryptionContext: encryptionContext)) + + let isEffectivelyMuted: Bool + switch self.isMutedValue { + case let .muted(isPushToTalkActive): + isEffectivelyMuted = !isPushToTalkActive + case .unmuted: + isEffectivelyMuted = false + } + genericCallContext.setIsMuted(isEffectivelyMuted) } self.genericCallContext = genericCallContext @@ -1907,6 +1922,14 @@ public final class PresentationGroupCallImpl: PresentationGroupCall { } else { reference = .id(id: callInfo.id, accessHash: callInfo.accessHash) } + + let isEffectivelyMuted: Bool + switch self.isMutedValue { + case let .muted(isPushToTalkActive): + isEffectivelyMuted = !isPushToTalkActive + case .unmuted: + isEffectivelyMuted = false + } self.currentLocalSsrc = ssrc self.requestDisposable.set((self.accountContext.engine.calls.joinGroupCall( @@ -1914,7 +1937,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall { joinAs: self.joinAsPeerId, callId: callInfo.id, reference: reference, - preferMuted: true, + preferMuted: isEffectivelyMuted, joinPayload: joinPayload, peerAdminIds: peerAdminIds, inviteHash: self.invite,