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 7e18d60095..a034896f77 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 @@ -89,6 +89,7 @@ object CallInfoView { ParticipantsState( inCallLobby = state.callState == WebRtcViewModel.State.CALL_PRE_JOIN, ringGroup = state.ringGroup, + isGroupOrAdHocCall = state.groupCallState.isNotIdle, includeSelf = state.groupCallState === WebRtcViewModel.GroupCallState.CONNECTED_AND_JOINED || state.groupCallState === WebRtcViewModel.GroupCallState.IDLE, participantCount = if (state.participantCount.isPresent) state.participantCount.get().toInt() else 0, remoteParticipants = state.allRemoteParticipants.sortedBy { it.callParticipantId.recipientId }, @@ -345,6 +346,7 @@ private fun CallInfo( callParticipant = participant, isSelfAdmin = controlAndInfoState.isSelfAdmin(), isCallLink = controlAndInfoState.callLink != null, + canRemoteMute = participantsState.isGroupOrAdHocCall, onDismiss = { selectedParticipant = null }, onMuteAudio = onMuteAudio, onRemoveFromCall = onRemoveFromCall, @@ -702,6 +704,7 @@ private fun UnknownMembersRowPreview() { private data class ParticipantsState( val inCallLobby: Boolean = false, val ringGroup: Boolean = true, + val isGroupOrAdHocCall: Boolean = false, val includeSelf: Boolean = false, val participantCount: Int = 0, val remoteParticipants: List = emptyList(), diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/ParticipantActionsSheet.kt b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/ParticipantActionsSheet.kt index 11ee85d148..bd30497097 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/ParticipantActionsSheet.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/controls/ParticipantActionsSheet.kt @@ -46,6 +46,7 @@ fun ParticipantActionsSheet( callParticipant: CallParticipant, isSelfAdmin: Boolean, isCallLink: Boolean, + canRemoteMute: Boolean, onDismiss: () -> Unit, onMuteAudio: (CallParticipant) -> Unit, onRemoveFromCall: (CallParticipant) -> Unit, @@ -71,6 +72,7 @@ fun ParticipantActionsSheet( callParticipant = callParticipant, isSelfAdmin = isSelfAdmin, isCallLink = isCallLink, + canRemoteMute = canRemoteMute, onDismiss = onDismiss, onMuteAudio = onMuteAudio, onRemoveFromCall = onRemoveFromCall, @@ -87,6 +89,7 @@ private fun ParticipantActionsSheetContent( callParticipant: CallParticipant, isSelfAdmin: Boolean, isCallLink: Boolean, + canRemoteMute: Boolean, onDismiss: () -> Unit, onMuteAudio: (CallParticipant) -> Unit, onRemoveFromCall: (CallParticipant) -> Unit, @@ -96,7 +99,7 @@ private fun ParticipantActionsSheetContent( ) { ParticipantHeader(recipient = recipient) - if (callParticipant.isMicrophoneEnabled) { + if (canRemoteMute && callParticipant.isMicrophoneEnabled) { Dividers.Default() Rows.TextRow( @@ -110,7 +113,7 @@ private fun ParticipantActionsSheetContent( } if (isSelfAdmin && isCallLink) { - if (!callParticipant.isMicrophoneEnabled) { + if (!(canRemoteMute && callParticipant.isMicrophoneEnabled)) { Dividers.Default() } @@ -207,6 +210,7 @@ private fun ParticipantActionsSheetAdminPreview() { ), isSelfAdmin = true, isCallLink = true, + canRemoteMute = true, onDismiss = {}, onMuteAudio = {}, onRemoveFromCall = {}, @@ -228,6 +232,7 @@ private fun ParticipantActionsSheetNonAdminPreview() { ), isSelfAdmin = false, isCallLink = false, + canRemoteMute = true, onDismiss = {}, onMuteAudio = {}, onRemoveFromCall = {},