From: Mattia Basaglia Date: Thu, 26 Jun 2014 13:23:13 +0000 (+0200) Subject: Use correct nick on 001 RPL_WELCOME X-Git-Tag: 0.11.0~27 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=77611288238aef3777466f5d647dd2780f5f72d1 Use correct nick on 001 RPL_WELCOME 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. --- diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index bc7f88b8..f3e94e85 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -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()); } diff --git a/src/core/coresessioneventprocessor.h b/src/core/coresessioneventprocessor.h index 47acf086..b981be3a 100644 --- a/src/core/coresessioneventprocessor.h +++ b/src/core/coresessioneventprocessor.h @@ -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