Merge pull request #32 from PM2-IT21bWIN-ruiz-mach-krea/Fixing_private_Messages

fixed Problem "private Messages are visible for sender"
This commit is contained in:
fassband 2022-04-13 17:35:48 +02:00 committed by GitHub Enterprise
commit 7c68472859
1 changed files with 3 additions and 0 deletions

View File

@ -149,6 +149,9 @@ public class ServerConnectionHandler implements Runnable{
ServerConnectionHandler handler = connectionRegistry.get(reciever); ServerConnectionHandler handler = connectionRegistry.get(reciever);
if (handler != null) { if (handler != null) {
handler.sendData(sender, reciever, type, payload); 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 { } else {
this.sendData(USER_NONE, userName, DATA_TYPE_ERROR, "Unknown User: " + reciever); this.sendData(USER_NONE, userName, DATA_TYPE_ERROR, "Unknown User: " + reciever);
} }