mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix mute for me
This commit is contained in:
parent
25215d542b
commit
4fc0114144
@ -413,7 +413,7 @@ public final class ManagedAudioSession {
|
||||
}, deactivate: deactivate)
|
||||
}
|
||||
|
||||
public func push(audioSessionType: ManagedAudioSessionType, outputMode: AudioSessionOutputMode = .system, once: Bool = false, manualActivate: @escaping (ManagedAudioSessionControl) -> Void, deactivate: @escaping () -> Signal<Void, NoError>, headsetConnectionStatusChanged: @escaping (Bool) -> Void = { _ in }, availableOutputsChanged: @escaping ([AudioSessionOutput], AudioSessionOutput?) -> Void = { _, _ in }) -> Disposable {
|
||||
public func push(audioSessionType: ManagedAudioSessionType, outputMode: AudioSessionOutputMode = .system, once: Bool = false, activateImmediately: Bool = false, manualActivate: @escaping (ManagedAudioSessionControl) -> Void, deactivate: @escaping () -> Signal<Void, NoError>, headsetConnectionStatusChanged: @escaping (Bool) -> Void = { _ in }, availableOutputsChanged: @escaping ([AudioSessionOutput], AudioSessionOutput?) -> Void = { _, _ in }) -> Disposable {
|
||||
let id = OSAtomicIncrement32(&self.nextId)
|
||||
let queue = self.queue
|
||||
queue.async {
|
||||
@ -422,7 +422,7 @@ public final class ManagedAudioSession {
|
||||
if let strongSelf = self {
|
||||
for holder in strongSelf.holders {
|
||||
if holder.id == id && holder.active {
|
||||
strongSelf.setup(type: audioSessionType, outputMode: holder.outputMode, activateNow: false)
|
||||
strongSelf.setup(type: audioSessionType, outputMode: holder.outputMode, activateNow: activateImmediately)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -582,7 +582,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
self.audioOutputStatePromise.set(.single(([], .speaker)))
|
||||
}
|
||||
|
||||
self.audioSessionDisposable = audioSession.push(audioSessionType: .voiceCall, manualActivate: { [weak self] control in
|
||||
self.audioSessionDisposable = audioSession.push(audioSessionType: .voiceCall, activateImmediately: true, manualActivate: { [weak self] control in
|
||||
Queue.mainQueue().async {
|
||||
if let strongSelf = self {
|
||||
strongSelf.updateSessionState(internalState: strongSelf.internalState, audioSessionControl: control)
|
||||
@ -1486,14 +1486,14 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
if let ssrc = participant.ssrc {
|
||||
strongSelf.ssrcMapping[ssrc] = participant.peer.id
|
||||
}
|
||||
|
||||
var filteredMuteState = participant.muteState
|
||||
if isReconnectingAsSpeaker || strongSelf.currentConnectionMode != .rtc {
|
||||
filteredMuteState = GroupCallParticipantsContext.Participant.MuteState(canUnmute: false, mutedByYou: false)
|
||||
participant.muteState = filteredMuteState
|
||||
}
|
||||
|
||||
if participant.peer.id == strongSelf.joinAsPeerId {
|
||||
var filteredMuteState = participant.muteState
|
||||
if isReconnectingAsSpeaker || strongSelf.currentConnectionMode != .rtc {
|
||||
filteredMuteState = GroupCallParticipantsContext.Participant.MuteState(canUnmute: false, mutedByYou: false)
|
||||
participant.muteState = filteredMuteState
|
||||
}
|
||||
|
||||
let previousRaisedHand = strongSelf.stateValue.raisedHand
|
||||
if !(strongSelf.stateValue.muteState?.canUnmute ?? false) {
|
||||
strongSelf.stateValue.raisedHand = participant.raiseHandRating != nil
|
||||
|
@ -960,9 +960,6 @@ public final class GroupCallParticipantsContext {
|
||||
let accountPeerId = self.account.peerId
|
||||
return self.statePromise.get()
|
||||
|> map { state -> State in
|
||||
if state.overlayState.isEmpty {
|
||||
return state.state
|
||||
}
|
||||
var publicState = state.state
|
||||
var sortAgain = false
|
||||
let canSeeHands = state.state.isCreator || state.state.adminIds.contains(accountPeerId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user