mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Support Muted by admin in conference
This commit is contained in:
parent
dcde323740
commit
6ee705e786
@ -65,9 +65,9 @@ final class VideoChatActionButtonComponent: Component {
|
||||
}
|
||||
}
|
||||
|
||||
enum MicrophoneState {
|
||||
enum MicrophoneState: Equatable {
|
||||
case connecting
|
||||
case muted
|
||||
case muted(forced: Bool)
|
||||
case unmuted
|
||||
case raiseHand
|
||||
case scheduled
|
||||
|
@ -182,7 +182,7 @@ final class VideoChatMicButtonComponent: Component {
|
||||
|
||||
enum Content: Equatable {
|
||||
case connecting
|
||||
case muted
|
||||
case muted(forced: Bool)
|
||||
case unmuted(pushToTalk: Bool)
|
||||
case raiseHand(isRaised: Bool)
|
||||
case scheduled(state: ScheduledState)
|
||||
@ -263,9 +263,13 @@ final class VideoChatMicButtonComponent: Component {
|
||||
switch component.content {
|
||||
case .connecting, .unmuted, .raiseHand, .scheduled:
|
||||
self.beginTrackingWasPushToTalk = false
|
||||
case .muted:
|
||||
self.beginTrackingWasPushToTalk = true
|
||||
component.updateUnmutedStateIsPushToTalk(true)
|
||||
case let .muted(forced):
|
||||
if forced {
|
||||
self.beginTrackingWasPushToTalk = false
|
||||
} else {
|
||||
self.beginTrackingWasPushToTalk = true
|
||||
component.updateUnmutedStateIsPushToTalk(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -291,8 +295,11 @@ final class VideoChatMicButtonComponent: Component {
|
||||
switch component.content {
|
||||
case .connecting:
|
||||
break
|
||||
case .muted:
|
||||
component.updateUnmutedStateIsPushToTalk(false)
|
||||
case let .muted(forced):
|
||||
if forced {
|
||||
} else {
|
||||
component.updateUnmutedStateIsPushToTalk(false)
|
||||
}
|
||||
case .unmuted:
|
||||
if self.beginTrackingWasPushToTalk {
|
||||
if timestamp < self.beginTrackingTimestamp + 0.15 {
|
||||
@ -340,8 +347,12 @@ final class VideoChatMicButtonComponent: Component {
|
||||
case .connecting:
|
||||
titleText = component.strings.VoiceChat_Connecting
|
||||
isEnabled = false
|
||||
case .muted:
|
||||
titleText = component.strings.VoiceChat_Unmute
|
||||
case let .muted(forced):
|
||||
if forced {
|
||||
titleText = component.strings.VoiceChat_MutedByAdmin
|
||||
} else {
|
||||
titleText = component.strings.VoiceChat_Unmute
|
||||
}
|
||||
case let .unmuted(isPushToTalk):
|
||||
titleText = isPushToTalk ? component.strings.VoiceChat_Live : component.strings.VoiceChat_Mute
|
||||
case let .raiseHand(isRaised):
|
||||
|
@ -2553,9 +2553,12 @@ final class VideoChatScreenComponent: Component {
|
||||
micButtonContent = .unmuted(pushToTalk: self.isPushToTalkActive)
|
||||
actionButtonMicrophoneState = .unmuted
|
||||
} else {
|
||||
micButtonContent = .muted
|
||||
actionButtonMicrophoneState = .muted
|
||||
micButtonContent = .muted(forced: false)
|
||||
actionButtonMicrophoneState = .muted(forced: false)
|
||||
}
|
||||
} else if isConference {
|
||||
micButtonContent = .muted(forced: true)
|
||||
actionButtonMicrophoneState = .muted(forced: true)
|
||||
} else {
|
||||
micButtonContent = .raiseHand(isRaised: callState.raisedHand)
|
||||
actionButtonMicrophoneState = .raiseHand
|
||||
|
Loading…
x
Reference in New Issue
Block a user