mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge branches 'master' and 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
dae9f1e967
@ -5935,8 +5935,8 @@ Sorry for the inconvenience.";
|
|||||||
"VoiceChat.Audio" = "audio";
|
"VoiceChat.Audio" = "audio";
|
||||||
"VoiceChat.Leave" = "leave";
|
"VoiceChat.Leave" = "leave";
|
||||||
|
|
||||||
"VoiceChat.SpeakPermissionEveryone" = "All Members Can Speak";
|
"VoiceChat.SpeakPermissionEveryone" = "New participants can speak";
|
||||||
"VoiceChat.SpeakPermissionAdmin" = "Only Admins Can Speak";
|
"VoiceChat.SpeakPermissionAdmin" = "New paricipants are muted";
|
||||||
"VoiceChat.Share" = "Share Invite Link";
|
"VoiceChat.Share" = "Share Invite Link";
|
||||||
"VoiceChat.EndVoiceChat" = "End Voice Chat";
|
"VoiceChat.EndVoiceChat" = "End Voice Chat";
|
||||||
|
|
||||||
@ -5974,7 +5974,7 @@ Sorry for the inconvenience.";
|
|||||||
"VoiceChat.Panel.MembersSpeaking_many" = "%@ members speaking";
|
"VoiceChat.Panel.MembersSpeaking_many" = "%@ members speaking";
|
||||||
"VoiceChat.Panel.MembersSpeaking_any" = "%@ members speaking";
|
"VoiceChat.Panel.MembersSpeaking_any" = "%@ members speaking";
|
||||||
|
|
||||||
"ChannelInfo.CreateVoiceChat" = "Create Voice Chat";
|
"ChannelInfo.CreateVoiceChat" = "Start Voice Chat";
|
||||||
|
|
||||||
"VoiceChat.AnonymousDisabledAlertText" = "Sorry, you can't join voice chat as an anonymous admin.";
|
"VoiceChat.AnonymousDisabledAlertText" = "Sorry, you can't join voice chat as an anonymous admin.";
|
||||||
|
|
||||||
|
@ -771,17 +771,20 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
self.isMutedValue = action
|
self.isMutedValue = action
|
||||||
self.isMutedPromise.set(self.isMutedValue)
|
self.isMutedPromise.set(self.isMutedValue)
|
||||||
let isEffectivelyMuted: Bool
|
let isEffectivelyMuted: Bool
|
||||||
|
let isVisuallyMuted: Bool
|
||||||
switch self.isMutedValue {
|
switch self.isMutedValue {
|
||||||
case let .muted(isPushToTalkActive):
|
case let .muted(isPushToTalkActive):
|
||||||
isEffectivelyMuted = true
|
isEffectivelyMuted = !isPushToTalkActive
|
||||||
|
isVisuallyMuted = 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
|
||||||
|
isVisuallyMuted = false
|
||||||
self.updateMuteState(peerId: self.accountContext.account.peerId, isMuted: false)
|
self.updateMuteState(peerId: self.accountContext.account.peerId, isMuted: false)
|
||||||
}
|
}
|
||||||
self.callContext?.setIsMuted(isEffectivelyMuted)
|
self.callContext?.setIsMuted(isEffectivelyMuted)
|
||||||
|
|
||||||
if isEffectivelyMuted {
|
if isVisuallyMuted {
|
||||||
self.stateValue.muteState = GroupCallParticipantsContext.Participant.MuteState(canUnmute: true)
|
self.stateValue.muteState = GroupCallParticipantsContext.Participant.MuteState(canUnmute: true)
|
||||||
} else {
|
} else {
|
||||||
self.stateValue.muteState = nil
|
self.stateValue.muteState = nil
|
||||||
|
@ -291,6 +291,14 @@ public final class VoiceChatController: ViewController {
|
|||||||
|
|
||||||
private var callState: PresentationGroupCallState?
|
private var callState: PresentationGroupCallState?
|
||||||
|
|
||||||
|
private var effectiveMuteState: GroupCallParticipantsContext.Participant.MuteState? {
|
||||||
|
if self.pushingToTalk {
|
||||||
|
return nil
|
||||||
|
} else {
|
||||||
|
return self.callState?.muteState
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var audioOutputStateDisposable: Disposable?
|
private var audioOutputStateDisposable: Disposable?
|
||||||
private var audioOutputState: ([AudioSessionOutput], AudioSessionOutput?)?
|
private var audioOutputState: ([AudioSessionOutput], AudioSessionOutput?)?
|
||||||
|
|
||||||
@ -473,7 +481,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
guard let strongSelf = self else {
|
guard let strongSelf = self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
strongSelf.updateMembers(muteState: strongSelf.callState?.muteState, groupMembers: state.list, callMembers: strongSelf.currentCallMembers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set(), invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
strongSelf.updateMembers(muteState: strongSelf.effectiveMuteState, groupMembers: state.list, callMembers: strongSelf.currentCallMembers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set(), invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -483,7 +491,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if let groupMembers = strongSelf.currentGroupMembers {
|
if let groupMembers = strongSelf.currentGroupMembers {
|
||||||
strongSelf.updateMembers(muteState: strongSelf.callState?.muteState, groupMembers: groupMembers, callMembers: callMembers.participants, speakingPeers: callMembers.speakingParticipants, invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
strongSelf.updateMembers(muteState: strongSelf.effectiveMuteState, groupMembers: groupMembers, callMembers: callMembers.participants, speakingPeers: callMembers.speakingParticipants, invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
||||||
} else {
|
} else {
|
||||||
strongSelf.currentCallMembers = callMembers.participants
|
strongSelf.currentCallMembers = callMembers.participants
|
||||||
}
|
}
|
||||||
@ -500,7 +508,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if let groupMembers = strongSelf.currentGroupMembers {
|
if let groupMembers = strongSelf.currentGroupMembers {
|
||||||
strongSelf.updateMembers(muteState: strongSelf.callState?.muteState, groupMembers: groupMembers, callMembers: strongSelf.currentCallMembers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set(), invitedPeers: invitedPeers)
|
strongSelf.updateMembers(muteState: strongSelf.effectiveMuteState, groupMembers: groupMembers, callMembers: strongSelf.currentCallMembers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set(), invitedPeers: invitedPeers)
|
||||||
} else {
|
} else {
|
||||||
strongSelf.currentInvitedPeers = invitedPeers
|
strongSelf.currentInvitedPeers = invitedPeers
|
||||||
}
|
}
|
||||||
@ -560,7 +568,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if wasMuted != (state.muteState != nil), let groupMembers = strongSelf.currentGroupMembers {
|
if wasMuted != (state.muteState != nil), let groupMembers = strongSelf.currentGroupMembers {
|
||||||
strongSelf.updateMembers(muteState: state.muteState, groupMembers: groupMembers, callMembers: strongSelf.currentCallMembers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set(), invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
strongSelf.updateMembers(muteState: strongSelf.effectiveMuteState, groupMembers: groupMembers, callMembers: strongSelf.currentCallMembers ?? [], speakingPeers: strongSelf.currentSpeakingPeers ?? Set(), invitedPeers: strongSelf.currentInvitedPeers ?? Set())
|
||||||
}
|
}
|
||||||
|
|
||||||
if let (layout, navigationHeight) = strongSelf.validLayout {
|
if let (layout, navigationHeight) = strongSelf.validLayout {
|
||||||
@ -800,6 +808,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
if let (layout, navigationHeight) = self.validLayout {
|
if let (layout, navigationHeight) = self.validLayout {
|
||||||
self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .animated(duration: 0.3, curve: .spring))
|
self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .animated(duration: 0.3, curve: .spring))
|
||||||
}
|
}
|
||||||
|
self.updateMembers(muteState: self.effectiveMuteState, groupMembers: self.currentGroupMembers ?? [], callMembers: self.currentCallMembers ?? [], speakingPeers: self.currentSpeakingPeers ?? Set(), invitedPeers: self.currentInvitedPeers ?? Set())
|
||||||
case .ended, .cancelled:
|
case .ended, .cancelled:
|
||||||
self.hapticFeedback.impact(.veryLight)
|
self.hapticFeedback.impact(.veryLight)
|
||||||
|
|
||||||
@ -814,6 +823,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
if let (layout, navigationHeight) = self.validLayout {
|
if let (layout, navigationHeight) = self.validLayout {
|
||||||
self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .animated(duration: 0.3, curve: .spring))
|
self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .animated(duration: 0.3, curve: .spring))
|
||||||
}
|
}
|
||||||
|
self.updateMembers(muteState: self.effectiveMuteState, groupMembers: self.currentGroupMembers ?? [], callMembers: self.currentCallMembers ?? [], speakingPeers: self.currentSpeakingPeers ?? Set(), invitedPeers: self.currentInvitedPeers ?? Set())
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user