diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantsState.kt b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantsState.kt index 326145ae37..3ff572785c 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantsState.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/CallParticipantsState.kt @@ -53,7 +53,12 @@ data class CallParticipantsState( val raisedHands: List get() { - val results = allRemoteParticipants.filter { it.isHandRaised }.map { GroupCallRaiseHandEvent(it.recipient, it.handRaisedTimestamp) }.toMutableList() + val results = allRemoteParticipants.asSequence() + .filter { it.isHandRaised } + .distinctBy { it.recipient } + .map { GroupCallRaiseHandEvent(it.recipient, it.handRaisedTimestamp) } + .sortedBy { it.timestamp } + .toMutableList() if (localParticipant.isHandRaised) { results.add(GroupCallRaiseHandEvent(localParticipant.recipient, localParticipant.handRaisedTimestamp)) } diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/CallInfoView.kt b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/CallInfoView.kt index 22083b910d..a8a424e1c2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/CallInfoView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/CallInfoView.kt @@ -246,7 +246,7 @@ private fun CallInfo( if (!participantsState.inCallLobby || participantsState.isOngoing()) { items( - items = participantsState.participantsForList, + items = participantsState.participantsForList.distinctBy { it.callParticipantId }, key = { it.callParticipantId }, contentType = { null } ) { diff --git a/app/src/main/java/org/thoughtcrime/securesms/events/CallParticipant.kt b/app/src/main/java/org/thoughtcrime/securesms/events/CallParticipant.kt index 5c37196f64..5dbdf43971 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/events/CallParticipant.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/events/CallParticipant.kt @@ -7,7 +7,7 @@ import org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink import org.thoughtcrime.securesms.recipients.Recipient import org.thoughtcrime.securesms.ringrtc.CameraState -data class CallParticipant constructor( +data class CallParticipant( val callParticipantId: CallParticipantId = CallParticipantId(Recipient.UNKNOWN), val recipient: Recipient = Recipient.UNKNOWN, val identityKey: IdentityKey? = null,