diff options
Diffstat (limited to 'src/Client/ChatClient.java')
-rw-r--r-- | src/Client/ChatClient.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Client/ChatClient.java b/src/Client/ChatClient.java index 679d51c..6499b75 100644 --- a/src/Client/ChatClient.java +++ b/src/Client/ChatClient.java @@ -71,6 +71,11 @@ public class ChatClient writer.sendLine(line); } + private void earlySendline(String line) + { + writer.sendLine(line); + } + /** */ public void PRIVMSG (String line) { @@ -95,14 +100,18 @@ public class ChatClient public void fixNickCollision() { String newNick = getNick() + new Integer((int) (Math.random()*1000)).toString(); - runSendline("NICK " + newNick); + earlySendline("NICK " + newNick); + } + + public void startup() { + earlySendline("NICK " + this.getNick()); + earlySendline("USER " + this.getNick() + " 0 * :" + this.getRealname()); } /** Initial setup with the server once the nick was set up*/ - public void startup() + public void joinChannel() { // 0: mode (nothing special). *: unused in RFC 2812, server name in RFC 1459 - runSendline("USER " + this.getNick() + " 0 * :" + this.getRealname()); runSendline("JOIN " + this.CHANNEL); this.setConnected(); // FIXME: Not sure yet if client is connected. } |