Assume remote video is initially active for video calls, don't show remote toasts before call activation

This commit is contained in:
Ilya Laktyushin
2020-08-07 22:25:39 +03:00
parent 23ef77e230
commit 107375f17e
3 changed files with 31 additions and 13 deletions

View File

@@ -925,24 +925,29 @@ final class CallControllerNode: ViewControllerTracingNode, CallControllerNodePro
}
var toastContent: CallControllerToastContent = []
if self.hasVideoNodes && [.inactive, .paused].contains(callState.remoteVideoState) {
toastContent.insert(.camera)
}
if case .muted = callState.remoteAudioState {
toastContent.insert(.microphone)
if callState.state.isOrWasActive {
if self.hasVideoNodes && [.inactive, .paused].contains(callState.remoteVideoState) {
toastContent.insert(.camera)
}
if case .muted = callState.remoteAudioState {
toastContent.insert(.microphone)
}
if case .low = callState.remoteBatteryLevel {
toastContent.insert(.battery)
}
}
if self.isMuted, let (availableOutputs, _) = self.audioOutputState, availableOutputs.count > 2 {
toastContent.insert(.mute)
}
if case .low = callState.remoteBatteryLevel {
toastContent.insert(.battery)
}
self.toastContent = toastContent
self.updateButtonsMode()
self.updateDimVisibility()
if self.incomingVideoViewRequested && !self.outgoingVideoViewRequested && !self.displayedCameraTooltip {
if self.incomingVideoViewRequested && self.outgoingVideoViewRequested {
self.displayedCameraTooltip = true
}
if self.incomingVideoViewRequested && !self.outgoingVideoViewRequested && !self.displayedCameraTooltip && toastContent.isEmpty {
self.displayedCameraTooltip = true
Queue.mainQueue().after(2.0) {
self.displayCameraTooltip()