mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-06-28 10:05:45 +01:00
Don't show remote mute in 1:1 calls.
This commit is contained in:
+3
@@ -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<CallParticipant> = emptyList(),
|
||||
|
||||
+7
-2
@@ -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 = {},
|
||||
|
||||
Reference in New Issue
Block a user