From 45224741fd6f11b032004f48faaea46c89e2e075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 15 Nov 2022 21:49:09 +0100 Subject: [PATCH] Fix ParticipantDisplayItems not updated on events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ParticipantDisplayItems were associated to both the session ID and the video stream type ("video" or "screen"), but the code that gets them was not updated to include the video stream type in the key. Signed-off-by: Daniel Calviño Sánchez --- .../talk/activities/CallActivity.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) 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 5198149b1..7fc54561f 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -2164,21 +2164,22 @@ public class CallActivity extends CallBaseActivity { @Subscribe(threadMode = ThreadMode.MAIN) public void onMessageEvent(PeerConnectionEvent peerConnectionEvent) { String sessionId = peerConnectionEvent.getSessionId(); + String participantDisplayItemId = sessionId + "-" + peerConnectionEvent.getVideoStreamType(); if (peerConnectionEvent.getPeerConnectionEventType() == PeerConnectionEvent.PeerConnectionEventType.PEER_CONNECTED) { if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) { updateSelfVideoViewConnected(true); - } else if (participantDisplayItems.get(sessionId) != null) { - participantDisplayItems.get(sessionId).setConnected(true); + } else if (participantDisplayItems.get(participantDisplayItemId) != null) { + participantDisplayItems.get(participantDisplayItemId).setConnected(true); participantsAdapter.notifyDataSetChanged(); } } else if (peerConnectionEvent.getPeerConnectionEventType() == PeerConnectionEvent.PeerConnectionEventType.PEER_DISCONNECTED) { if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) { updateSelfVideoViewConnected(false); - } else if (participantDisplayItems.get(sessionId) != null) { - participantDisplayItems.get(sessionId).setConnected(false); + } else if (participantDisplayItems.get(participantDisplayItemId) != null) { + participantDisplayItems.get(participantDisplayItemId).setConnected(false); participantsAdapter.notifyDataSetChanged(); } } else if (peerConnectionEvent.getPeerConnectionEventType() == @@ -2200,20 +2201,20 @@ public class CallActivity extends CallBaseActivity { } } else if (peerConnectionEvent.getPeerConnectionEventType() == PeerConnectionEvent.PeerConnectionEventType.NICK_CHANGE) { - if (participantDisplayItems.get(sessionId) != null) { - participantDisplayItems.get(sessionId).setNick(peerConnectionEvent.getNick()); + if (participantDisplayItems.get(participantDisplayItemId) != null) { + participantDisplayItems.get(participantDisplayItemId).setNick(peerConnectionEvent.getNick()); participantsAdapter.notifyDataSetChanged(); } } else if (peerConnectionEvent.getPeerConnectionEventType() == PeerConnectionEvent.PeerConnectionEventType.VIDEO_CHANGE && !isVoiceOnlyCall) { - if (participantDisplayItems.get(sessionId) != null) { - participantDisplayItems.get(sessionId).setStreamEnabled(peerConnectionEvent.getChangeValue()); + if (participantDisplayItems.get(participantDisplayItemId) != null) { + participantDisplayItems.get(participantDisplayItemId).setStreamEnabled(peerConnectionEvent.getChangeValue()); participantsAdapter.notifyDataSetChanged(); } } else if (peerConnectionEvent.getPeerConnectionEventType() == PeerConnectionEvent.PeerConnectionEventType.AUDIO_CHANGE) { - if (participantDisplayItems.get(sessionId) != null) { - participantDisplayItems.get(sessionId).setAudioEnabled(peerConnectionEvent.getChangeValue()); + if (participantDisplayItems.get(participantDisplayItemId) != null) { + participantDisplayItems.get(participantDisplayItemId).setAudioEnabled(peerConnectionEvent.getChangeValue()); participantsAdapter.notifyDataSetChanged(); } } else if (peerConnectionEvent.getPeerConnectionEventType() ==