mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +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 connecting
|
||||||
case muted
|
case muted(forced: Bool)
|
||||||
case unmuted
|
case unmuted
|
||||||
case raiseHand
|
case raiseHand
|
||||||
case scheduled
|
case scheduled
|
||||||
|
@ -182,7 +182,7 @@ final class VideoChatMicButtonComponent: Component {
|
|||||||
|
|
||||||
enum Content: Equatable {
|
enum Content: Equatable {
|
||||||
case connecting
|
case connecting
|
||||||
case muted
|
case muted(forced: Bool)
|
||||||
case unmuted(pushToTalk: Bool)
|
case unmuted(pushToTalk: Bool)
|
||||||
case raiseHand(isRaised: Bool)
|
case raiseHand(isRaised: Bool)
|
||||||
case scheduled(state: ScheduledState)
|
case scheduled(state: ScheduledState)
|
||||||
@ -263,9 +263,13 @@ final class VideoChatMicButtonComponent: Component {
|
|||||||
switch component.content {
|
switch component.content {
|
||||||
case .connecting, .unmuted, .raiseHand, .scheduled:
|
case .connecting, .unmuted, .raiseHand, .scheduled:
|
||||||
self.beginTrackingWasPushToTalk = false
|
self.beginTrackingWasPushToTalk = false
|
||||||
case .muted:
|
case let .muted(forced):
|
||||||
self.beginTrackingWasPushToTalk = true
|
if forced {
|
||||||
component.updateUnmutedStateIsPushToTalk(true)
|
self.beginTrackingWasPushToTalk = false
|
||||||
|
} else {
|
||||||
|
self.beginTrackingWasPushToTalk = true
|
||||||
|
component.updateUnmutedStateIsPushToTalk(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,8 +295,11 @@ final class VideoChatMicButtonComponent: Component {
|
|||||||
switch component.content {
|
switch component.content {
|
||||||
case .connecting:
|
case .connecting:
|
||||||
break
|
break
|
||||||
case .muted:
|
case let .muted(forced):
|
||||||
component.updateUnmutedStateIsPushToTalk(false)
|
if forced {
|
||||||
|
} else {
|
||||||
|
component.updateUnmutedStateIsPushToTalk(false)
|
||||||
|
}
|
||||||
case .unmuted:
|
case .unmuted:
|
||||||
if self.beginTrackingWasPushToTalk {
|
if self.beginTrackingWasPushToTalk {
|
||||||
if timestamp < self.beginTrackingTimestamp + 0.15 {
|
if timestamp < self.beginTrackingTimestamp + 0.15 {
|
||||||
@ -340,8 +347,12 @@ final class VideoChatMicButtonComponent: Component {
|
|||||||
case .connecting:
|
case .connecting:
|
||||||
titleText = component.strings.VoiceChat_Connecting
|
titleText = component.strings.VoiceChat_Connecting
|
||||||
isEnabled = false
|
isEnabled = false
|
||||||
case .muted:
|
case let .muted(forced):
|
||||||
titleText = component.strings.VoiceChat_Unmute
|
if forced {
|
||||||
|
titleText = component.strings.VoiceChat_MutedByAdmin
|
||||||
|
} else {
|
||||||
|
titleText = component.strings.VoiceChat_Unmute
|
||||||
|
}
|
||||||
case let .unmuted(isPushToTalk):
|
case let .unmuted(isPushToTalk):
|
||||||
titleText = isPushToTalk ? component.strings.VoiceChat_Live : component.strings.VoiceChat_Mute
|
titleText = isPushToTalk ? component.strings.VoiceChat_Live : component.strings.VoiceChat_Mute
|
||||||
case let .raiseHand(isRaised):
|
case let .raiseHand(isRaised):
|
||||||
|
@ -2553,9 +2553,12 @@ final class VideoChatScreenComponent: Component {
|
|||||||
micButtonContent = .unmuted(pushToTalk: self.isPushToTalkActive)
|
micButtonContent = .unmuted(pushToTalk: self.isPushToTalkActive)
|
||||||
actionButtonMicrophoneState = .unmuted
|
actionButtonMicrophoneState = .unmuted
|
||||||
} else {
|
} else {
|
||||||
micButtonContent = .muted
|
micButtonContent = .muted(forced: false)
|
||||||
actionButtonMicrophoneState = .muted
|
actionButtonMicrophoneState = .muted(forced: false)
|
||||||
}
|
}
|
||||||
|
} else if isConference {
|
||||||
|
micButtonContent = .muted(forced: true)
|
||||||
|
actionButtonMicrophoneState = .muted(forced: true)
|
||||||
} else {
|
} else {
|
||||||
micButtonContent = .raiseHand(isRaised: callState.raisedHand)
|
micButtonContent = .raiseHand(isRaised: callState.raisedHand)
|
||||||
actionButtonMicrophoneState = .raiseHand
|
actionButtonMicrophoneState = .raiseHand
|
||||||
|
Loading…
x
Reference in New Issue
Block a user