Split remote user check for group vs individual calls.

This commit is contained in:
Alex Hart
2024-12-02 13:47:35 -04:00
committed by Greyson Parrelli
parent 3c086f347e
commit d6be14a95f
3 changed files with 9 additions and 1 deletions

View File

@@ -320,7 +320,7 @@ public class WebRtcCallViewModel extends ViewModel {
webRtcViewModel.isRemoteVideoEnabled(),
webRtcViewModel.isRemoteVideoOffer(),
localParticipant.isMoreThanOneCameraAvailable(),
webRtcViewModel.getRemoteDevicesCount().orElse(0L) > 0,
webRtcViewModel.hasAtLeastOneRemote(),
webRtcViewModel.getActiveDevice(),
webRtcViewModel.getAvailableDevices(),
webRtcViewModel.getRemoteDevicesCount().orElse(0),

View File

@@ -8,6 +8,7 @@ import androidx.annotation.Px;
import androidx.annotation.StringRes;
import androidx.annotation.VisibleForTesting;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.webrtc.audio.SignalAudioManager;

View File

@@ -105,6 +105,13 @@ class WebRtcViewModel(state: WebRtcServiceState) {
val isCallLink: Boolean = state.callInfoState.callRecipient.isCallLink
val callLinkDisconnectReason: CallLinkDisconnectReason? = state.callInfoState.callLinkDisconnectReason
@get:JvmName("hasAtLeastOneRemote")
val hasAtLeastOneRemote = if (state.callInfoState.callRecipient.isIndividual) {
remoteParticipants.isNotEmpty()
} else {
remoteDevicesCount.orElse(0L) > 0L
}
@get:JvmName("shouldRingGroup")
val ringGroup: Boolean = state.getCallSetupState(state.callInfoState.activePeer?.callId).ringGroup
val ringerRecipient: Recipient = state.getCallSetupState(state.callInfoState.activePeer?.callId).ringerRecipient