Explorar o código

Fix call state when join call response is received after signaling

When a call is joined the call flags of the local participant change, so
this causes a signaling message to be sent by the server. When the HPB
is used the signaling message is sent through a WebSocket, which is
already connected before joining the call. Therefore, in some cases the
signaling message can be received through the WebSocket even before the
response to the HTTP "joinCall" request.

If there are other participants in the call the call state is changed to
"IN_CONVERSATION" when the signaling message is processed. However, in
the case described above the call state was then set to "JOINED", which
automatically traverses to "CONNECTION_TIMEOUT" if no other call state
was set in 45 seconds. Due to all this the call was joined and the
connections with the other participants were established, but they were
not visible in the UI (although they could be heard) and after 45
seconds the call was left.

To prevent that now the call state is changed to "JOINED" if it was not
already changed to "IN_CONVERSATION" in the meantime.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Daniel Calviño Sánchez %!s(int64=2) %!d(string=hai) anos
pai
achega
379ec8eae8

+ 3 - 1
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -1442,7 +1442,9 @@ public class CallActivity extends CallBaseActivity {
                 @Override
                 @Override
                 public void onNext(@io.reactivex.annotations.NonNull GenericOverall genericOverall) {
                 public void onNext(@io.reactivex.annotations.NonNull GenericOverall genericOverall) {
                     if (currentCallStatus != CallStatus.LEAVING) {
                     if (currentCallStatus != CallStatus.LEAVING) {
-                        setCallState(CallStatus.JOINED);
+                        if (currentCallStatus != CallStatus.IN_CONVERSATION) {
+                            setCallState(CallStatus.JOINED);
+                        }
 
 
                         ApplicationWideCurrentRoomHolder.getInstance().setInCall(true);
                         ApplicationWideCurrentRoomHolder.getInstance().setInCall(true);
                         ApplicationWideCurrentRoomHolder.getInstance().setDialing(false);
                         ApplicationWideCurrentRoomHolder.getInstance().setDialing(false);