|
@@ -44,7 +44,7 @@ public class WebSocketConnectionHelper {
|
|
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
|
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
|
|
}
|
|
}
|
|
|
|
|
|
- public static synchronized MagicWebSocketInstance getExternalSignalingInstanceForServer(String url, UserEntity userEntity, String webSocketTicket) {
|
|
|
|
|
|
+ public static synchronized MagicWebSocketInstance getExternalSignalingInstanceForServer(String url, UserEntity userEntity, String webSocketTicket, boolean isGuest) {
|
|
String generatedURL = url.replace("https://", "wss://").replace("http://", "ws://");
|
|
String generatedURL = url.replace("https://", "wss://").replace("http://", "ws://");
|
|
|
|
|
|
if (generatedURL.endsWith("/")) {
|
|
if (generatedURL.endsWith("/")) {
|
|
@@ -53,10 +53,16 @@ public class WebSocketConnectionHelper {
|
|
generatedURL += "/spreed";
|
|
generatedURL += "/spreed";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ long userId = isGuest ? -1 : userEntity.getId();
|
|
|
|
+
|
|
|
|
+
|
|
MagicWebSocketInstance magicWebSocketInstance;
|
|
MagicWebSocketInstance magicWebSocketInstance;
|
|
- if (magicWebSocketInstanceMap.containsKey(userEntity.getId()) && (magicWebSocketInstance = magicWebSocketInstanceMap.get(userEntity.getId())) != null && !magicWebSocketInstance.isPermanentlyClosed()) {
|
|
|
|
|
|
+ if (userId != -1 && magicWebSocketInstanceMap.containsKey(userEntity.getId()) && (magicWebSocketInstance = magicWebSocketInstanceMap.get(userEntity.getId())) != null && !magicWebSocketInstance.isPermanentlyClosed()) {
|
|
return magicWebSocketInstance;
|
|
return magicWebSocketInstance;
|
|
} else {
|
|
} else {
|
|
|
|
+ if (userId == -1) {
|
|
|
|
+ deleteExternalSignalingInstanceForUserEntity(userId);
|
|
|
|
+ }
|
|
magicWebSocketInstance = new MagicWebSocketInstance(userEntity, generatedURL, webSocketTicket);
|
|
magicWebSocketInstance = new MagicWebSocketInstance(userEntity, generatedURL, webSocketTicket);
|
|
magicWebSocketInstanceMap.put(userEntity.getId(), magicWebSocketInstance);
|
|
magicWebSocketInstanceMap.put(userEntity.getId(), magicWebSocketInstance);
|
|
return magicWebSocketInstance;
|
|
return magicWebSocketInstance;
|