mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Voice Chat UI fixes
This commit is contained in:
@@ -21,7 +21,8 @@ private extension PresentationGroupCallState {
|
||||
networkState: .connecting,
|
||||
canManageCall: false,
|
||||
adminIds: Set(),
|
||||
muteState: GroupCallParticipantsContext.Participant.MuteState(canUnmute: true)
|
||||
muteState: GroupCallParticipantsContext.Participant.MuteState(canUnmute: true),
|
||||
defaultParticipantMuteState: nil
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -389,7 +390,7 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
}
|
||||
}
|
||||
}
|
||||
case let .call(isTerminated):
|
||||
case let .call(isTerminated, _):
|
||||
if isTerminated {
|
||||
strongSelf._canBeRemoved.set(.single(true))
|
||||
}
|
||||
@@ -579,6 +580,9 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
self.summaryInfoState.set(.single(SummaryInfoState(info: callInfo)))
|
||||
|
||||
self.stateValue.canManageCall = initialState.isCreator || initialState.adminIds.contains(self.accountContext.account.peerId)
|
||||
if self.stateValue.canManageCall && initialState.defaultParticipantsAreMuted.canChange {
|
||||
self.stateValue.defaultParticipantMuteState = initialState.defaultParticipantsAreMuted.isMuted ? .muted : .unmuted
|
||||
}
|
||||
|
||||
self.ssrcMapping.removeAll()
|
||||
var ssrcs: [UInt32] = []
|
||||
@@ -640,6 +644,10 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
|
||||
strongSelf.stateValue.adminIds = state.adminIds
|
||||
|
||||
if (state.isCreator || state.adminIds.contains(strongSelf.accountContext.account.peerId)) && state.defaultParticipantsAreMuted.canChange {
|
||||
strongSelf.stateValue.defaultParticipantMuteState = state.defaultParticipantsAreMuted.isMuted ? .muted : .unmuted
|
||||
}
|
||||
|
||||
strongSelf.summaryParticipantsState.set(.single(SummaryParticipantsState(
|
||||
participantCount: state.totalCount,
|
||||
topParticipants: topParticipants,
|
||||
@@ -921,4 +929,8 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func updateDefaultParticipantsAreMuted(isMuted: Bool) {
|
||||
self.participantsContext?.updateDefaultParticipantsAreMuted(isMuted: isMuted)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user