Start WebSocket before registering its presence

This commit is contained in:
Fedor Indutnyy 2021-08-27 13:31:42 -07:00 committed by Jon Chambers
parent d1735c7e57
commit 703405b874
1 changed files with 1 additions and 1 deletions

View File

@ -91,9 +91,9 @@ public class AuthenticatedConnectListener implements WebSocketConnectListener {
});
try {
connection.start();
clientPresenceManager.setPresent(auth.getAccount().getUuid(), device.getId(), connection);
messagesManager.addMessageAvailabilityListener(auth.getAccount().getUuid(), device.getId(), connection);
connection.start();
} catch (final Exception e) {
log.warn("Failed to initialize websocket", e);
context.getClient().close(1011, "Unexpected error initializing connection");