summaryrefslogtreecommitdiff
path: root/src/Server/CommandsTable.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Server/CommandsTable.java')
-rw-r--r--src/Server/CommandsTable.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Server/CommandsTable.java b/src/Server/CommandsTable.java
index 4ae3651..d1d093c 100644
--- a/src/Server/CommandsTable.java
+++ b/src/Server/CommandsTable.java
@@ -47,10 +47,17 @@ abstract class Command
}
}
+
public void printUser(Client client, String str)
{
+ printUser (client ,client, str);
+ }
+
+
+ public void printUser(Client client,Client sender, String str)
+ {
try {
- client.println(":" + client.getNick() + "!" + client.getUsername() + "@" + client.getHostname() + str);
+ client.println(":" + sender .getNick() + "!" + client.getUsername() + "@" + client.getHostname() + " " + str);
} catch (IOException e) {
System.err.println("Failed to print to client socket: <" + str + "> (" + e + ")");
}
@@ -85,7 +92,7 @@ class CommandPrivmsg extends Command
continue;
}
ports += con.toString();
- this.println(con.getClient(), "PRIVMSG " + starr[0] + " :" + line);
+ this.printUser(con.getClient(), client, "PRIVMSG " + starr[0] + " :" + line);
}
System.err.println("printed message to ports: " + ports);
}
@@ -113,7 +120,7 @@ class CommandJoin extends Command
{
// FIXME : parse args to channel names and save client state
// but right now everybody is on a single channel
- this.printUser(client, " JOIN " + ":" + args);
+ this.printUser(client, "JOIN " + ":" + args);
this.println(client, "332 " + client.getNick() + " " + args + " :Welcome to the single channel");
//this.println(client, "333 " + client.getNick()) + args + "someone!somewhere";
}