mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix push to talk
This commit is contained in:
parent
593ffd6c02
commit
ae82aeb0b0
@ -759,7 +759,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
let isEffectivelyMuted: Bool
|
let isEffectivelyMuted: Bool
|
||||||
switch self.isMutedValue {
|
switch self.isMutedValue {
|
||||||
case let .muted(isPushToTalkActive):
|
case let .muted(isPushToTalkActive):
|
||||||
isEffectivelyMuted = !isPushToTalkActive
|
isEffectivelyMuted = true
|
||||||
self.updateMuteState(peerId: self.accountContext.account.peerId, isMuted: true)
|
self.updateMuteState(peerId: self.accountContext.account.peerId, isMuted: true)
|
||||||
case .unmuted:
|
case .unmuted:
|
||||||
isEffectivelyMuted = false
|
isEffectivelyMuted = false
|
||||||
|
@ -797,15 +797,21 @@ public final class VoiceChatController: ViewController {
|
|||||||
self.pushingToTalk = true
|
self.pushingToTalk = true
|
||||||
self.call.setIsMuted(action: .muted(isPushToTalkActive: true))
|
self.call.setIsMuted(action: .muted(isPushToTalkActive: true))
|
||||||
}
|
}
|
||||||
|
if let (layout, navigationHeight) = self.validLayout {
|
||||||
|
self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .animated(duration: 0.3, curve: .spring))
|
||||||
|
}
|
||||||
case .ended, .cancelled:
|
case .ended, .cancelled:
|
||||||
self.pushingToTalk = false
|
self.pushingToTalk = false
|
||||||
self.actionButton.pressing = false
|
self.actionButton.pressing = false
|
||||||
let timestamp = CACurrentMediaTime()
|
let timestamp = CACurrentMediaTime()
|
||||||
if callState.muteState != nil || timestamp - self.actionButtonPressGestureStartTime < 0.1 {
|
if timestamp - self.actionButtonPressGestureStartTime < 0.1 {
|
||||||
self.call.toggleIsMuted()
|
self.call.toggleIsMuted()
|
||||||
} else {
|
} else {
|
||||||
self.call.setIsMuted(action: .muted(isPushToTalkActive: false))
|
self.call.setIsMuted(action: .muted(isPushToTalkActive: false))
|
||||||
}
|
}
|
||||||
|
if let (layout, navigationHeight) = self.validLayout {
|
||||||
|
self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .animated(duration: 0.3, curve: .spring))
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -925,7 +931,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
audioButtonAppearance = .color(.custom(0x1c1c1e))
|
audioButtonAppearance = .color(.custom(0x1c1c1e))
|
||||||
actionButtonEnabled = false
|
actionButtonEnabled = false
|
||||||
case .connected:
|
case .connected:
|
||||||
if let muteState = callState.muteState {
|
if let muteState = callState.muteState, !self.pushingToTalk {
|
||||||
if muteState.canUnmute {
|
if muteState.canUnmute {
|
||||||
actionButtonState = .active(state: .muted)
|
actionButtonState = .active(state: .muted)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user