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>
This commit is contained in:
Daniel Calviño Sánchez 2022-09-19 04:30:15 +02:00
parent fdbcc3b16d
commit 13a04808d9

View File

@ -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'");