Voice Chat UI fixes

This commit is contained in:
Ali
2020-11-30 19:02:16 +04:00
parent c42525c87c
commit 131d80a1d9
5 changed files with 103 additions and 8 deletions

View File

@@ -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)
}
}