Add GroupCall.JoinState.PENDING support.

This commit is contained in:
Alex Hart 2023-08-08 15:41:54 -03:00
parent 30d0b6fd0e
commit 6898595f8a
5 changed files with 14 additions and 3 deletions

View file

@ -640,6 +640,9 @@ public class WebRtcCallView extends ConstraintLayout {
case CONNECTED_AND_JOINING:
setStatus(R.string.WebRtcCallView__joining);
break;
case CONNECTED_AND_PENDING:
setStatus(R.string.WebRtcCallView__waiting_to_be_let_in);
break;
case CONNECTING:
case CONNECTED_AND_JOINED:
case CONNECTED:

View file

@ -426,6 +426,7 @@ public class WebRtcCallViewModel extends ViewModel {
break;
case CONNECTED:
case CONNECTED_AND_JOINING:
case CONNECTED_AND_PENDING:
case CONNECTED_AND_JOINED:
groupCallState = WebRtcControls.GroupCallState.CONNECTED;
break;

View file

@ -55,6 +55,7 @@ class WebRtcViewModel(state: WebRtcServiceState) {
CONNECTING,
RECONNECTING,
CONNECTED,
CONNECTED_AND_PENDING,
CONNECTED_AND_JOINING,
CONNECTED_AND_JOINED;
@ -67,7 +68,7 @@ class WebRtcViewModel(state: WebRtcServiceState) {
val isConnected: Boolean
get() {
return when (this) {
CONNECTED, CONNECTED_AND_JOINING, CONNECTED_AND_JOINED -> true
CONNECTED, CONNECTED_AND_JOINING, CONNECTED_AND_JOINED, CONNECTED_AND_PENDING -> true
else -> false
}
}

View file

@ -100,11 +100,15 @@ public class GroupJoiningActionProcessor extends GroupActionProcessor {
.commit()
.actionProcessor(actionProcessorFactory.createConnectedActionProcessor(webRtcInteractor));
} else if (device.getJoinState() == GroupCall.JoinState.JOINING || device.getJoinState() == GroupCall.JoinState.PENDING) {
} else if (device.getJoinState() == GroupCall.JoinState.JOINING) {
builder.changeCallInfoState()
.groupCallState(WebRtcViewModel.GroupCallState.CONNECTED_AND_JOINING)
.commit();
} else {
} else if (device.getJoinState() == GroupCall.JoinState.PENDING) {
builder.changeCallInfoState()
.groupCallState(WebRtcViewModel.GroupCallState.CONNECTED_AND_PENDING)
.commit();
}else {
builder.changeCallInfoState()
.groupCallState(WebRtcUtil.groupCallStateForConnection(device.getConnectionState()))
.commit();

View file

@ -1774,6 +1774,8 @@
<string name="WebRtcCallView__signal_call_link">Signal call link</string>
<!-- Warning displayed when entering a call via a link -->
<string name="WebRtcCallView__anyone_who_joins">Anyone who joins this call via the link will see your name, photo, and phone number.</string>
<!-- Displayed on the call screen as the status when waiting to be let into a call link by an admin -->
<string name="WebRtcCallView__waiting_to_be_let_in">Waiting to be let in…</string>
<string name="WebRtcCallView__signal_will_ring_s">Signal will ring %1$s</string>
<string name="WebRtcCallView__signal_will_ring_s_and_s">Signal will ring %1$s and %2$s</string>