mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix min group call participant updates
This commit is contained in:
parent
248e8f7f12
commit
907fb84da1
@ -1301,10 +1301,14 @@ public final class GroupCallParticipantsContext {
|
|||||||
var previousJoinTimestamp: Int32?
|
var previousJoinTimestamp: Int32?
|
||||||
var previousActivityTimestamp: Double?
|
var previousActivityTimestamp: Double?
|
||||||
var previousActivityRank: Int?
|
var previousActivityRank: Int?
|
||||||
|
var previousMuteState: GroupCallParticipantsContext.Participant.MuteState?
|
||||||
|
var previousVolume: Int32?
|
||||||
if let index = updatedParticipants.firstIndex(where: { $0.peer.id == participantUpdate.peerId }) {
|
if let index = updatedParticipants.firstIndex(where: { $0.peer.id == participantUpdate.peerId }) {
|
||||||
previousJoinTimestamp = updatedParticipants[index].joinTimestamp
|
previousJoinTimestamp = updatedParticipants[index].joinTimestamp
|
||||||
previousActivityTimestamp = updatedParticipants[index].activityTimestamp
|
previousActivityTimestamp = updatedParticipants[index].activityTimestamp
|
||||||
previousActivityRank = updatedParticipants[index].activityRank
|
previousActivityRank = updatedParticipants[index].activityRank
|
||||||
|
previousMuteState = updatedParticipants[index].muteState
|
||||||
|
previousVolume = updatedParticipants[index].volume
|
||||||
updatedParticipants.remove(at: index)
|
updatedParticipants.remove(at: index)
|
||||||
} else if case .joined = participantUpdate.participationStatusChange {
|
} else if case .joined = participantUpdate.participationStatusChange {
|
||||||
updatedTotalCount += 1
|
updatedTotalCount += 1
|
||||||
@ -1318,6 +1322,19 @@ public final class GroupCallParticipantsContext {
|
|||||||
activityTimestamp = participantUpdate.activityTimestamp ?? previousActivityTimestamp
|
activityTimestamp = participantUpdate.activityTimestamp ?? previousActivityTimestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var volume = participantUpdate.volume
|
||||||
|
var muteState = participantUpdate.muteState
|
||||||
|
if participantUpdate.isMin {
|
||||||
|
if let previousMuteState = previousMuteState {
|
||||||
|
if previousMuteState.mutedByYou {
|
||||||
|
muteState = previousMuteState
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let previousVolume = previousVolume {
|
||||||
|
volume = previousVolume
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let participant = Participant(
|
let participant = Participant(
|
||||||
peer: peer,
|
peer: peer,
|
||||||
ssrc: participantUpdate.ssrc,
|
ssrc: participantUpdate.ssrc,
|
||||||
@ -1327,8 +1344,8 @@ public final class GroupCallParticipantsContext {
|
|||||||
hasRaiseHand: participantUpdate.raiseHandRating != nil,
|
hasRaiseHand: participantUpdate.raiseHandRating != nil,
|
||||||
activityTimestamp: activityTimestamp,
|
activityTimestamp: activityTimestamp,
|
||||||
activityRank: previousActivityRank,
|
activityRank: previousActivityRank,
|
||||||
muteState: participantUpdate.muteState,
|
muteState: muteState,
|
||||||
volume: participantUpdate.volume,
|
volume: volume,
|
||||||
about: participantUpdate.about
|
about: participantUpdate.about
|
||||||
)
|
)
|
||||||
updatedParticipants.append(participant)
|
updatedParticipants.append(participant)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user