diff options
author | Vitaly Takmazov | 2018-05-28 00:24:09 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-05-28 00:24:09 +0300 |
commit | becc5e008199c94ffce1435839d85999b57f131b (patch) | |
tree | 0839e208773352e4d4be6d7ba50801bcf4f9bed1 /juick-server/src/main/java/com/juick/server/WebsocketManager.java | |
parent | 4319a2c2de6391f3e42993e96675a64baf9f0d78 (diff) |
ws fixes
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/WebsocketManager.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/WebsocketManager.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/WebsocketManager.java b/juick-server/src/main/java/com/juick/server/WebsocketManager.java index 5c976416..1d09ad77 100644 --- a/juick-server/src/main/java/com/juick/server/WebsocketManager.java +++ b/juick-server/src/main/java/com/juick/server/WebsocketManager.java @@ -133,7 +133,7 @@ public class WebsocketManager extends TextWebSocketHandler { public void afterConnectionClosed(WebSocketSession session, CloseStatus status) { synchronized (clients) { logger.debug("session closed with status {}: {}", status.getCode(), status.getReason()); - clients.removeIf(c -> c.session.getId().equals(session.getId())); + clients.removeIf(c -> c.session.getDelegate().getId().equals(session.getId())); logger.debug("{} clients connected", clients.size()); } @@ -154,7 +154,7 @@ public class WebsocketManager extends TextWebSocketHandler { @Override protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception { - User user = clients.stream().filter(c -> c.session.equals(session)).map(c -> c.visitor) + User user = clients.stream().filter(c -> c.session.getDelegate().equals(session)).map(c -> c.visitor) .findFirst().orElse(AnonymousUser.INSTANCE); if (!user.isAnonymous()) { String command = message.getPayload().trim(); |