浏览代码

Ignore signaling messages when the call activity is closing

The call activity unregisters from the event bus events when stopped.
However, when the call activity is being closed the new activity can
start before the call activity is stopped; if the new activity causes
new signaling messages to be sent those messages were handled by the
call activity too.

The chat controller joins the conversation again when it is attached,
and the call activity automatically joins the call when it receives a
"roomJoined" event. Due to all that, when the call activity was closed
and the chat controller was opened the call was joined again (and then
left once the call activity was finally destroyed).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Daniel Calviño Sánchez 2 年之前
父节点
当前提交
13a04808d9
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

+ 4 - 0
app/src/main/java/com/nextcloud/talk/activities/CallActivity.java

@@ -1483,6 +1483,10 @@ public class CallActivity extends CallBaseActivity {
 
     @Subscribe(threadMode = ThreadMode.BACKGROUND)
     public void onMessageEvent(WebSocketCommunicationEvent webSocketCommunicationEvent) {
+        if (CallStatus.LEAVING.equals(currentCallStatus)) {
+            return;
+        }
+
         switch (webSocketCommunicationEvent.getType()) {
             case "hello":
                 Log.d(TAG, "onMessageEvent 'hello'");