Confrence updates

This commit is contained in:
Isaac 2025-04-10 19:56:53 +04:00
parent 8b0030ca9b
commit 84ad1344c7
2 changed files with 26 additions and 3 deletions

View File

@ -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)

View File

@ -860,6 +860,12 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
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(
engine: accountContext.engine,
@ -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
@ -1908,13 +1923,21 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
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(
peerId: self.peerId,
joinAs: self.joinAsPeerId,
callId: callInfo.id,
reference: reference,
preferMuted: true,
preferMuted: isEffectivelyMuted,
joinPayload: joinPayload,
peerAdminIds: peerAdminIds,
inviteHash: self.invite,