Fix mute behavior

This commit is contained in:
Ali 2020-12-04 17:46:38 +00:00
parent 8549684667
commit ae40d322ca
2 changed files with 16 additions and 2 deletions

View File

@ -864,9 +864,23 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
if participant.peer.id == strongSelf.accountContext.account.peerId {
if let muteState = participant.muteState {
strongSelf.stateValue.muteState = muteState
if muteState.canUnmute {
switch strongSelf.isMutedValue {
case let .muted(isPushToTalkActive):
if !isPushToTalkActive {
strongSelf.callContext?.setIsMuted(true)
}
case .unmuted:
strongSelf.isMutedValue = .muted(isPushToTalkActive: false)
strongSelf.callContext?.setIsMuted(true)
}
} else {
strongSelf.isMutedValue = .muted(isPushToTalkActive: false)
strongSelf.callContext?.setIsMuted(true)
}
strongSelf.stateValue.muteState = muteState
} else if let currentMuteState = strongSelf.stateValue.muteState, !currentMuteState.canUnmute {
strongSelf.isMutedValue = .muted(isPushToTalkActive: false)
strongSelf.stateValue.muteState = GroupCallParticipantsContext.Participant.MuteState(canUnmute: true)
strongSelf.callContext?.setIsMuted(true)
}

@ -1 +1 @@
Subproject commit 7c6b9e7e74fd3f7197df7632d3f8170de1cb23f5
Subproject commit 738dea0e5042e6d43b26f5425bcc07eafda3437f