瀏覽代碼

Fix joining a call

Signed-off-by: Joas Schilling <coding@schilljs.com>
Joas Schilling 4 年之前
父節點
當前提交
dde79b5671

+ 3 - 3
app/src/main/java/com/nextcloud/talk/controllers/CallController.java

@@ -2044,11 +2044,11 @@ public class CallController extends BaseController {
             nick = getPeerConnectionWrapperForSessionIdAndType(session, videoStreamType, false).getNick();
         }
 
-        String userId;
+        String userId = "";
         if (hasMCU) {
             userId = webSocketClient.getUserIdForSession(session);
-        } else {
-            userId = participantMap.get(session).getUserId();
+        } else if (participantMap.get(session).getActorType() == Participant.ActorType.USERS) {
+            userId = participantMap.get(session).getActorId();
         }
 
         String urlForAvatar;

+ 10 - 4
app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java

@@ -399,16 +399,22 @@ public class MagicWebSocketInstance extends WebSocketListener {
     }
 
     public String getDisplayNameForSession(String session) {
-        if (usersHashMap.containsKey(session)) {
-            return usersHashMap.get(session).getDisplayName();
+        Participant participant = usersHashMap.get(session);
+        if (participant != null) {
+            if (participant.getDisplayName() != null) {
+                return participant.getDisplayName();
+            }
         }
 
         return NextcloudTalkApplication.Companion.getSharedApplication().getString(R.string.nc_nick_guest);
     }
 
     public String getUserIdForSession(String session) {
-        if (usersHashMap.containsKey(session)) {
-            return usersHashMap.get(session).getUserId();
+        Participant participant = usersHashMap.get(session);
+        if (participant != null) {
+            if (participant.getActorType() == Participant.ActorType.USERS) {
+                return participant.getActorId();
+            }
         }
 
         return "";