Switch if to switch :)

This commit is contained in:
Mario Danic 2018-10-17 08:34:02 +02:00
parent 5a3f199f14
commit f6b1dca677

View file

@ -1190,16 +1190,20 @@ public class CallController extends BaseController {
@Subscribe(threadMode = ThreadMode.BACKGROUND)
public void onMessageEvent(WebSocketCommunicationEvent webSocketCommunicationEvent) {
if (webSocketCommunicationEvent.getType().equals("hello")) {
callSession = webSocketClient.getSessionId();
webSocketClient.joinRoomWithRoomToken(roomToken);
alwaysGetPeerConnectionWrapperForSessionId(callSession, true);
} else if ("participantsUpdate".equals(webSocketCommunicationEvent.getType())) {
if (webSocketCommunicationEvent.getHashMap().get("roomId").equals(roomToken)) {
processUsersInRoom((List<HashMap<String, Object>>) webSocketClient.getJobWithId(Integer.valueOf(webSocketCommunicationEvent.getHashMap().get("jobId"))));
}
} else if ("signalingMessage".equals(webSocketCommunicationEvent.getType())) {
processMessage((NCSignalingMessage) webSocketClient.getJobWithId(Integer.valueOf(webSocketCommunicationEvent.getHashMap().get("jobId"))));
switch (webSocketCommunicationEvent.getType()) {
case "hello":
callSession = webSocketClient.getSessionId();
webSocketClient.joinRoomWithRoomToken(roomToken);
alwaysGetPeerConnectionWrapperForSessionId(callSession, true);
break;
case "participantsUpdate":
if (webSocketCommunicationEvent.getHashMap().get("roomId").equals(roomToken)) {
processUsersInRoom((List<HashMap<String, Object>>) webSocketClient.getJobWithId(Integer.valueOf(webSocketCommunicationEvent.getHashMap().get("jobId"))));
}
break;
case "signalingMessage":
processMessage((NCSignalingMessage) webSocketClient.getJobWithId(Integer.valueOf(webSocketCommunicationEvent.getHashMap().get("jobId"))));
break;
}
}