Fix joining a call

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-05-07 23:44:38 +02:00
parent 335afb03dd
commit dde79b5671
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 13 additions and 7 deletions

View File

@ -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;

View File

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