Use correct nick on 001 RPL_WELCOME
authorMattia Basaglia <mattia.basaglia@gmail.com>
Thu, 26 Jun 2014 13:23:13 +0000 (15:23 +0200)
committerDaniel Albers <daniel@lbe.rs>
Thu, 10 Jul 2014 14:09:38 +0000 (16:09 +0200)
Fixes #1020
When the user connects to  a bouncer, the bouncer will send back the
welcome message received when it first connected to the network.
This caused Quassel to display a wrong nick if it had changed
since the first connection.

src/core/coresessioneventprocessor.cpp
src/core/coresessioneventprocessor.h

index bc7f88b..f3e94e8 100644 (file)
@@ -480,14 +480,10 @@ void CoreSessionEventProcessor::processKeyEvent(KeyEvent *e)
 
 
 /* RPL_WELCOME */
-void CoreSessionEventProcessor::processIrcEvent001(IrcEvent *e)
+void CoreSessionEventProcessor::processIrcEvent001(IrcEventNumeric *e)
 {
-    if (!checkParamCount(e, 1))
-        return;
-
-    QString myhostmask = e->params().at(0).section(' ', -1, -1);
     e->network()->setCurrentServer(e->prefix());
-    e->network()->setMyNick(nickFromMask(myhostmask));
+    e->network()->setMyNick(e->target());
 }
 
 
index 47acf08..b981be3 100644 (file)
@@ -63,7 +63,7 @@ public:
     Q_INVOKABLE void processKeyEvent(KeyEvent *event);
 #endif
 
-    Q_INVOKABLE void processIrcEvent001(IrcEvent *event);          // RPL_WELCOME
+    Q_INVOKABLE void processIrcEvent001(IrcEventNumeric *event);   // RPL_WELCOME
     Q_INVOKABLE void processIrcEvent005(IrcEvent *event);          // RPL_ISUPPORT
     Q_INVOKABLE void processIrcEvent221(IrcEvent *event);          // RPL_UMODEIS
     Q_INVOKABLE void processIrcEvent250(IrcEvent *event);          // RPL_STATSCONN