Closed GoogleCodeExporter closed 9 years ago
Nevermind, found the problem. In the method handleLine() in my pircbotx-1.8.jar
there's this:
else if (command.equals("NICK")) {
// Somebody is changing their nick.
String newNick = target;
if (sourceNick.equals(getNick()))
// Update our nick if it was us that changed nick.
setNick(newNick);
else getUser(sourceNick).setNick(newNick);
getListenerManager().dispatchEvent(new NickChangeEvent(this, sourceNick, newNick, source));
}
But in the current source on Google Code there's this:
else if (command.equals("NICK")) {
// Somebody is changing their nick.
String newNick = target;
getUser(sourceNick).setNick(newNick);
if (sourceNick.equals(getNick()))
// Update our nick if it was us that changed nick.
setNick(newNick);
getListenerManager().dispatchEvent(new NickChangeEvent(this, sourceNick, newNick, source));
}
It seems the newer source calls setNick on the actual User, even if it's a bot.
This issue should be closed.
Original comment by firefr...@gmail.com
on 31 Mar 2013 at 4:09
Yes, the bot itself has a user object because its included in the WHO and NAMES
replies.
I'm not sure where your pulling the first bit of code from though as since 1.0
its always set the nick of the user like in the second example:
https://code.google.com/p/pircbotx/source/browse/src/main/java/org/pircbotx/Pirc
BotX.java?name=1.0#1177
Thats the same code in the pircbotx-1.8-sources.zip file I just downloaded to
check
Original comment by Lord.Qua...@gmail.com
on 31 Mar 2013 at 7:57
Original issue reported on code.google.com by
firefr...@gmail.com
on 31 Mar 2013 at 3:42