diff --git a/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java b/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java index 7dd9c82..26ff699 100644 --- a/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java +++ b/server/src/main/java/ch/zhaw/pm2/multichat/server/ServerConnectionHandler.java @@ -149,6 +149,9 @@ public class ServerConnectionHandler implements Runnable{ ServerConnectionHandler handler = connectionRegistry.get(reciever); if (handler != null) { handler.sendData(sender, reciever, type, payload); + if(!reciever.equals(sender)){ + sendData(sender, reciever, type, payload); //send message to sender if it's a direct message and sender is not receiver. + } } else { this.sendData(USER_NONE, userName, DATA_TYPE_ERROR, "Unknown User: " + reciever); }