Tidy up the error replies.

This commit is contained in:
cnaude 2015-05-08 20:14:59 -07:00
parent 6be25284d1
commit 7b797b2ef8

View File

@ -48,17 +48,17 @@ public class ServerResponseListener extends ListenerAdapter {
@Override
public void onServerResponse(ServerResponseEvent event) {
int serverReply = event.getCode();
String rawMessage[] = event.getRawLine().split(" ", 5);
String target = rawMessage[3];
if (serverReply == ReplyConstants.ERR_NICKNAMEINUSE) {
plugin.logError("Nickname already in use.");
plugin.logInfo("[" + target + "] Nick is already in use.");
ircBot.altNickChange();
} else if (serverReply == ReplyConstants.ERR_BADCHANNELKEY) {
plugin.logError("Bad channel password.");
} else if (serverReply == ReplyConstants.ERR_BANNEDFROMCHAN) {
plugin.logError("Banned from the channel.");
plugin.logError("Cannot join " + target + " (Requires keyword)");
} else if (serverReply >= 400 && serverReply <= 599) {
plugin.logError(event.getRawLine());
}
}
}