+
+/* ERR_ERRONEUSNICKNAME */
+void Server::handleServer432(QString prefix, QStringList params) {
+ if(params.size() < 2) {
+ // handle unreal-ircd bug, where unreal ircd doesnt supply a TARGET in ERR_ERRONEUSNICKNAME during registration phase:
+ // nick @@@
+ // :irc.scortum.moep.net 432 @@@ :Erroneous Nickname: Illegal characters
+ // correct server reply:
+ // :irc.scortum.moep.net 432 * @@@ :Erroneous Nickname: Illegal characters
+ emit displayMsg(Message::Error, "", tr("There is a nickname in your identity's nicklist which contains illegal characters"));
+ emit displayMsg(Message::Error, "", tr("Due to a bug in Unreal IRCd (and maybe other irc-servers too) we're unable to determine the erroneous nick"));
+ emit displayMsg(Message::Error, "", tr("Please use: /nick <othernick> to continue or clean up your nicklist"));
+ } else {
+ QString errnick = params[0];
+ emit displayMsg(Message::Error, "", tr("Nick %1 contains illegal characters").arg(errnick));
+ // if there is a problem while connecting to the server -> we handle it
+ // TODO rely on another source...
+ if(currentServer.isEmpty()) {
+ QStringList desiredNicks = identity["NickList"].toStringList();
+ int nextNick = desiredNicks.indexOf(errnick) + 1;
+ if (desiredNicks.size() > nextNick) {
+ putCmd("NICK", QStringList(desiredNicks[nextNick]));
+ } else {
+ emit displayMsg(Message::Error, "", tr("No free and valid nicks in nicklist found. use: /nick <othernick> to continue"));
+ }
+ }
+ }
+}
+
+/* ERR_NICKNAMEINUSE */
+void Server::handleServer433(QString prefix, QStringList params) {
+ QString errnick = params[0];
+ emit displayMsg(Message::Error, "", tr("Nick %1 is already taken").arg(errnick));
+ // if there is a problem while connecting to the server -> we handle it
+ // TODO rely on another source...
+ if(currentServer.isEmpty()) {
+ QStringList desiredNicks = identity["NickList"].toStringList();
+ int nextNick = desiredNicks.indexOf(errnick) + 1;
+ if (desiredNicks.size() > nextNick) {
+ putCmd("NICK", QStringList(desiredNicks[nextNick]));
+ } else {
+ emit displayMsg(Message::Error, "", tr("No free and valid nicks in nicklist found. use: /nick <othernick> to continue"));
+ }
+ }
+}
+