mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Implement remote mute receive; Update to RingRTC v2.52.0
Co-authored-by: Alex Hart <alex@signal.org> Co-authored-by: Cody Henthorne <cody@signal.org>
This commit is contained in:
committed by
Cody Henthorne
parent
ed9a945f05
commit
3d7162cdd3
@@ -22,6 +22,7 @@ data class CallParticipant(
|
||||
val isMediaKeysReceived: Boolean = true,
|
||||
val addedToCallTime: Long = 0,
|
||||
val isScreenSharing: Boolean = false,
|
||||
val remotelyMutedBy: Recipient? = null,
|
||||
private val deviceOrdinal: DeviceOrdinal = DeviceOrdinal.PRIMARY
|
||||
) {
|
||||
val cameraDirection: CameraState.Direction
|
||||
@@ -68,7 +69,7 @@ data class CallParticipant(
|
||||
}
|
||||
|
||||
fun withAudioEnabled(audioEnabled: Boolean): CallParticipant {
|
||||
return copy(isMicrophoneEnabled = audioEnabled)
|
||||
return copy(isMicrophoneEnabled = audioEnabled, remotelyMutedBy = if (audioEnabled) null else remotelyMutedBy)
|
||||
}
|
||||
|
||||
fun withVideoEnabled(videoEnabled: Boolean): CallParticipant {
|
||||
@@ -83,8 +84,12 @@ data class CallParticipant(
|
||||
return copy(handRaisedTimestamp = timestamp)
|
||||
}
|
||||
|
||||
fun withRemotelyMutedBy(source: Recipient): CallParticipant {
|
||||
return copy(remotelyMutedBy = source)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "CallParticipant(callParticipantId=$callParticipantId, isForwardingVideo=$isForwardingVideo, isVideoEnabled=$isVideoEnabled, isMicrophoneEnabled=$isMicrophoneEnabled, handRaisedTimestamp=$handRaisedTimestamp, isMediaKeysReceived=$isMediaKeysReceived, isScreenSharing=$isScreenSharing)"
|
||||
return "CallParticipant(callParticipantId=$callParticipantId, isForwardingVideo=$isForwardingVideo, isVideoEnabled=$isVideoEnabled, isMicrophoneEnabled=$isMicrophoneEnabled, handRaisedTimestamp=$handRaisedTimestamp, isMediaKeysReceived=$isMediaKeysReceived, isScreenSharing=$isScreenSharing, remotelyMutedBy=$remotelyMutedBy)"
|
||||
}
|
||||
|
||||
enum class DeviceOrdinal {
|
||||
|
||||
@@ -129,6 +129,8 @@ class WebRtcViewModel(state: WebRtcServiceState) {
|
||||
state.localDeviceState.handRaisedTimestamp
|
||||
)
|
||||
|
||||
val remoteMutedBy: CallParticipant? = state.localDeviceState.remoteMutedBy
|
||||
|
||||
val isCellularConnection: Boolean = when (state.localDeviceState.networkConnectionType) {
|
||||
PeerConnection.AdapterType.UNKNOWN,
|
||||
PeerConnection.AdapterType.ETHERNET,
|
||||
@@ -166,7 +168,8 @@ class WebRtcViewModel(state: WebRtcServiceState) {
|
||||
activeDevice=$activeDevice,
|
||||
availableDevices=$availableDevices,
|
||||
bluetoothPermissionDenied=$bluetoothPermissionDenied,
|
||||
ringGroup=$ringGroup
|
||||
ringGroup=$ringGroup,
|
||||
remoteMutedBy=$remoteMutedBy
|
||||
}
|
||||
""".trimIndent()
|
||||
}
|
||||
@@ -197,6 +200,7 @@ class WebRtcViewModel(state: WebRtcServiceState) {
|
||||
if (availableDevices != previousEvent.availableDevices) builder.append(" availableDevices=$availableDevices\n")
|
||||
if (bluetoothPermissionDenied != previousEvent.bluetoothPermissionDenied) builder.append(" bluetoothPermissionDenied=$bluetoothPermissionDenied\n")
|
||||
if (ringGroup != previousEvent.ringGroup) builder.append(" ringGroup=$ringGroup\n")
|
||||
if (remoteMutedBy != previousEvent.remoteMutedBy) builder.append(" remoteMutedBy=$remoteMutedBy\n")
|
||||
|
||||
if (builder.isEmpty()) {
|
||||
"<no change>"
|
||||
|
||||
Reference in New Issue
Block a user