mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-23 21:50:31 +01:00
Fix websocket reconnection when a guest joins the conversation
When the standalone signaling server is used and a participant joins a conversation a "join" signaling message is received. The code assumed that the event always contains a "user" attribute, but that attribute is empty for guests. As the "user" attribute was used unconditionally this caused an exception, and as the exception happened when handling a websocket message it propagated until it caused a reconnection of the websocket. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
93c12a89de
commit
6846eb950b
@ -247,7 +247,10 @@ public class MagicWebSocketInstance extends WebSocketListener {
|
|||||||
HashMap<String, Object> userMap = (HashMap<String, Object>) internalHashMap.get("user");
|
HashMap<String, Object> userMap = (HashMap<String, Object>) internalHashMap.get("user");
|
||||||
participant = new Participant();
|
participant = new Participant();
|
||||||
participant.setUserId((String) internalHashMap.get("userid"));
|
participant.setUserId((String) internalHashMap.get("userid"));
|
||||||
|
if (userMap != null) {
|
||||||
|
// There is no "user" attribute for guest participants.
|
||||||
participant.setDisplayName((String) userMap.get("displayname"));
|
participant.setDisplayName((String) userMap.get("displayname"));
|
||||||
|
}
|
||||||
usersHashMap.put((String) internalHashMap.get("sessionid"), participant);
|
usersHashMap.put((String) internalHashMap.get("sessionid"), participant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user