The Core Configuration Wizard is back! teH rul!
[quassel.git] / src / core / ircserverhandler.cpp
index 6a220db..df4c65b 100644 (file)
@@ -155,9 +155,15 @@ void IrcServerHandler::defaultHandler(QString cmd, QString prefix, QList<QByteAr
         emit displayMsg(Message::Error, "", params.join(" "), prefix);
         break;
       // Server error messages, display them in red. First param will be appended.
-      case 401: case 402: case 403: case 404: case 406: case 408: case 415: case 421: case 442:
-      { QString p = params.takeFirst();
-        emit displayMsg(Message::Error, "", params.join(" ") + " " + p, prefix);
+      case 401: 
+      { QString channelName = params.takeFirst();
+        emit displayMsg(Message::Error, "", params.join(" ") + " " + channelName, prefix);
+        emit displayMsg(Message::Error, channelName, params.join(" ") + " " + channelName, prefix);
+        break;
+      }
+      case 402: case 403: case 404: case 406: case 408: case 415: case 421: case 442:
+      { QString channelName = params.takeFirst();
+        emit displayMsg(Message::Error, "", params.join(" ") + " " + channelName, prefix);
         break;
       }
       // Server error messages which will be displayed with a colon between the first param and the rest
@@ -285,9 +291,9 @@ void IrcServerHandler::handleNotice(QString prefix, QList<QByteArray> params) {
 
   QString target = serverDecode(params[0]);
 
-  // are we the target?
+  // kick notices to the server buffer if they are directly addressed to us
   if(network()->isMyNick(target))
-    target = nickFromMask(target);
+    target = QString("");
 
   networkConnection->ctcpHandler()->parse(Message::Notice, prefix, target, userDecode(prefix, params[1]));
 }
@@ -321,17 +327,11 @@ void IrcServerHandler::handlePrivmsg(QString prefix, QList<QByteArray> params) {
 
   // are we the target?
   if(network()->isMyNick(target))
-    target = nickFromMask(target);
+    target = nickFromMask(ircuser->nick());
 
   // it's possible to pack multiple privmsgs into one param using ctcp
   // - > we let the ctcpHandler do the work
   networkConnection->ctcpHandler()->parse(Message::Plain, prefix, target, userDecode(ircuser->nick(), params[1]));
-//   QStringList messages = 
-
-//   foreach(QString message, messages) {
-//     emit displayMsg(Message::Plain, target, message, prefix);
-//   }
-  
 }
 
 void IrcServerHandler::handleQuit(QString prefix, QList<QByteArray> params) {