diff --git a/src/main/java/envoy/server/ConnectionManager.java b/src/main/java/envoy/server/ConnectionManager.java index 0ae8fcc..202334f 100644 --- a/src/main/java/envoy/server/ConnectionManager.java +++ b/src/main/java/envoy/server/ConnectionManager.java @@ -60,7 +60,7 @@ public class ConnectionManager implements ISocketIdListener { */ public void registerUser(long userId, long socketId) { sockets.put(userId, socketId); - pendingSockets.remove(userId); + pendingSockets.remove(socketId); } /** diff --git a/src/main/java/envoy/server/processors/LoginCredentialProcessor.java b/src/main/java/envoy/server/processors/LoginCredentialProcessor.java index 71a55dc..376989a 100644 --- a/src/main/java/envoy/server/processors/LoginCredentialProcessor.java +++ b/src/main/java/envoy/server/processors/LoginCredentialProcessor.java @@ -1,6 +1,7 @@ package envoy.server.processors; import java.io.IOException; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -37,24 +38,14 @@ public class LoginCredentialProcessor implements ObjectProcessor users = PersistenceManager.getPersistenceManager() @@ -79,4 +70,25 @@ public class LoginCredentialProcessor implements ObjectProcessor { System.err.println("Recipient online. Failed to send message" + message.getId()); e.printStackTrace(); } - try {// sender receives confirmation that the server received the message - writeProxy.write(connectionManager.getSocketId(message.getSenderId()), - new MessageStatusChangeEvent(message.getId(), message.getStatus(), new Date())); - } catch (IOException e) { - e.printStackTrace(); - } PersistenceManager.getPersistenceManager().addMessage(new envoy.server.data.Message(message)); } }