diff options
Diffstat (limited to 'juick-server')
-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(); |