From 13a04808d97f2833f465f010d74086f1746a03fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 19 Sep 2022 04:30:15 +0200 Subject: [PATCH] Ignore signaling messages when the call activity is closing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../main/java/com/nextcloud/talk/activities/CallActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 4755db18a..3dc128ae9 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/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'");