mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 14:27:24 +00: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");
|
||||
participant = new Participant();
|
||||
participant.setUserId((String) internalHashMap.get("userid"));
|
||||
participant.setDisplayName((String) userMap.get("displayname"));
|
||||
if (userMap != null) {
|
||||
// There is no "user" attribute for guest participants.
|
||||
participant.setDisplayName((String) userMap.get("displayname"));
|
||||
}
|
||||
usersHashMap.put((String) internalHashMap.get("sessionid"), participant);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user