From aa5a081c02517fdbd9eff2f6abdf89659f0f0390 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Tue, 12 Apr 2011 22:06:54 +0200 Subject: [PATCH] Bugfix: Remember new nickname on auto nickname change (433: Nickname is already in use) --- application/src/org/jibble/pircbot/PircBot.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/src/org/jibble/pircbot/PircBot.java b/application/src/org/jibble/pircbot/PircBot.java index 4105cd1..4f95c01 100644 --- a/application/src/org/jibble/pircbot/PircBot.java +++ b/application/src/org/jibble/pircbot/PircBot.java @@ -179,6 +179,7 @@ public abstract class PircBot implements ReplyConstants { InputStreamReader inputStreamReader = null; OutputStreamWriter outputStreamWriter = null; + if (getEncoding() != null) { // Assume the specified encoding is valid for this JVM. inputStreamReader = new InputStreamReader(_socket.getInputStream(), getEncoding()); @@ -233,7 +234,6 @@ public abstract class PircBot implements ReplyConstants { } this.onConnect(); - } @@ -880,10 +880,10 @@ public abstract class PircBot implements ReplyConstants { if (_autoNickChange) { List aliases = getAliases(); _autoNickTries++; - String nick = ((_autoNickTries - 1) <= aliases.size()) ? + _nick = ((_autoNickTries - 1) <= aliases.size()) ? aliases.get(_autoNickTries - 2) : getName() + (_autoNickTries - aliases.size()); - this.sendRawLineViaQueue("NICK " + nick); + this.sendRawLineViaQueue("NICK " + _nick); } else { _socket.close();