+
+/* 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"));
+ }
+ }
+}
+
+/***********************************************************************************/
+// CTCP HANDLER
+
+void Server::handleCtcpAction(CtcpType ctcptype, QString prefix, QString target, QString param) {
+ emit displayMsg(Message::Action, target, param, prefix);
+}
+
+void Server::handleCtcpPing(CtcpType ctcptype, QString prefix, QString target, QString param) {
+ if(ctcptype == CtcpQuery) {
+ ctcpReply(userFromMask(prefix), "PING", param);
+ emit displayMsg(Message::Plain, "", tr("Received CTCP PING request by %1").arg(prefix));
+ } else {
+ // display ping answer
+ }
+}
+
+void Server::handleCtcpVersion(CtcpType ctcptype, QString prefix, QString target, QString param) {
+ if(ctcptype == CtcpQuery) {
+ // FIXME use real Info about quasel :)
+ ctcpReply(userFromMask(prefix), "VERSION", QString("Quassel:pre Release:*nix"));
+ emit displayMsg(Message::Plain, "", tr("Received CTCP VERSION request by %1").arg(prefix));
+ } else {
+ // TODO display Version answer
+ }
+}
+
+void Server::defaultCtcpHandler(CtcpType ctcptype, QString prefix, QString cmd, QString target, QString param) {
+ emit displayMsg(Message::Error, "", tr("Received unknown CTCP %1 by %2").arg(cmd).arg(prefix));
+}
+
+