mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-08 17:53:38 +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)
|
}, 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 id = OSAtomicIncrement32(&self.nextId)
|
||||||
let queue = self.queue
|
let queue = self.queue
|
||||||
queue.async {
|
queue.async {
|
||||||
@ -422,7 +422,7 @@ public final class ManagedAudioSession {
|
|||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
for holder in strongSelf.holders {
|
for holder in strongSelf.holders {
|
||||||
if holder.id == id && holder.active {
|
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
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -582,7 +582,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
self.audioOutputStatePromise.set(.single(([], .speaker)))
|
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 {
|
Queue.mainQueue().async {
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.updateSessionState(internalState: strongSelf.internalState, audioSessionControl: control)
|
strongSelf.updateSessionState(internalState: strongSelf.internalState, audioSessionControl: control)
|
||||||
@ -1486,14 +1486,14 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
if let ssrc = participant.ssrc {
|
if let ssrc = participant.ssrc {
|
||||||
strongSelf.ssrcMapping[ssrc] = participant.peer.id
|
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 {
|
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
|
let previousRaisedHand = strongSelf.stateValue.raisedHand
|
||||||
if !(strongSelf.stateValue.muteState?.canUnmute ?? false) {
|
if !(strongSelf.stateValue.muteState?.canUnmute ?? false) {
|
||||||
strongSelf.stateValue.raisedHand = participant.raiseHandRating != nil
|
strongSelf.stateValue.raisedHand = participant.raiseHandRating != nil
|
||||||
|
|||||||
@ -960,9 +960,6 @@ public final class GroupCallParticipantsContext {
|
|||||||
let accountPeerId = self.account.peerId
|
let accountPeerId = self.account.peerId
|
||||||
return self.statePromise.get()
|
return self.statePromise.get()
|
||||||
|> map { state -> State in
|
|> map { state -> State in
|
||||||
if state.overlayState.isEmpty {
|
|
||||||
return state.state
|
|
||||||
}
|
|
||||||
var publicState = state.state
|
var publicState = state.state
|
||||||
var sortAgain = false
|
var sortAgain = false
|
||||||
let canSeeHands = state.state.isCreator || state.state.adminIds.contains(accountPeerId)
|
let canSeeHands = state.state.isCreator || state.state.adminIds.contains(accountPeerId)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user