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