diff options
author | dor <dor1_b@walla.com> | 2014-03-14 20:49:48 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2014-03-16 03:06:04 +0200 |
commit | 96992731ecf46ec8578b950f63243792eb176ee9 (patch) | |
tree | c3b85da49cb1c755f2edc722104251e6362d447f | |
parent | fab63b7b17552f724a04459f0f60667f947aada6 (diff) |
Server: dont let originatore get its message.
-rw-r--r-- | src/Server/Client.java | 6 | ||||
-rw-r--r-- | src/Server/CommandsTable.java | 5 |
2 files changed, 11 insertions, 0 deletions
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); } |