From f6a518462c846acbdd4c50b2e729f507ac6a2b4d Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Wed, 9 Feb 2011 00:40:31 +0100 Subject: [PATCH] PircBot Patch: Set nickname outside of connect loop. Otherwise server replies setting the nickname during connect may be overwritten (bugfix for irssi proxy) --- application/src/org/jibble/pircbot/PircBot.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/src/org/jibble/pircbot/PircBot.java b/application/src/org/jibble/pircbot/PircBot.java index 17c4022..0adac98 100644 --- a/application/src/org/jibble/pircbot/PircBot.java +++ b/application/src/org/jibble/pircbot/PircBot.java @@ -203,6 +203,10 @@ public abstract class PircBot implements ReplyConstants { _inputThread = new InputThread(this, socket, breader, bwriter); + // XXX: PircBot Patch - Set nick before loop. otherwise we overwrite it in the loop again and again + // But maybe we got a new nickname from the server (bouncers!) + this.setNick(nick); + // Read stuff back from the server to see if we connected. String line = null; int tries = 1; @@ -240,7 +244,6 @@ public abstract class PircBot implements ReplyConstants { throw new IrcException("Could not log into the IRC server: " + line); } } - this.setNick(nick); } // XXX: PircBot patch - We are not connected to server if nothing received