From 96992731ecf46ec8578b950f63243792eb176ee9 Mon Sep 17 00:00:00 2001 From: dor Date: Fri, 14 Mar 2014 20:49:48 +0200 Subject: Server: dont let originatore get its message. --- src/Server/Client.java | 6 ++++++ src/Server/CommandsTable.java | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/Server/Client.java b/src/Server/Client.java index 315c363..73e5b3d 100644 --- a/src/Server/Client.java +++ b/src/Server/Client.java @@ -18,6 +18,12 @@ public class Client this.output = output; this.con = con; } + /** returning if an Connection is my'n */ + public boolean IfMyCon (Connection con) + { + return con == this.con; + } + /** returning the nick name */ public String getNick() { diff --git a/src/Server/CommandsTable.java b/src/Server/CommandsTable.java index ead56d9..d9b4110 100644 --- a/src/Server/CommandsTable.java +++ b/src/Server/CommandsTable.java @@ -79,6 +79,11 @@ class CommandPrivmsg extends Command while (iter.hasNext()) { Connection con = iter.next(); + + if (client.IfMyCon(con)) + { + continue; + } ports += con.toString(); this.println(con.getClient(), "PRIVMSG " + starr[0] + " :" + line); } -- cgit v1.2.3