From 3b8318c1ec0b20f4f04a4fa9f3d9c18c8301ca41 Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Thu, 26 Jun 2014 15:23:13 +0200 Subject: [PATCH] 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. --- src/core/coresessioneventprocessor.cpp | 8 ++------ src/core/coresessioneventprocessor.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index e31c20db..b33c4b09 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -477,14 +477,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 6854d18b..c8380d7b 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 -- 2.20.1