From: Shane Synan Date: Thu, 26 May 2016 23:04:53 +0000 (-0400) Subject: Hide AutoWho reply if channel/nick quits X-Git-Tag: travis-deploy-test~470^2~2 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=cbbf4720fc10f0cb78eca71fe6a3f859cbe7a3c7;hp=a2e096ed11221866f9707ad61265a9d359a21de3 Hide AutoWho reply if channel/nick quits If the given nick quits or channel is removed during an AutoWho, hide the ERR_NOSUCHCHANNEL reply, since the WHO reply would've been hidden too. Avoids showing the confusing "No such channel" error in the status buffer. --- diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index f86b1035..8acae81c 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -1092,6 +1092,22 @@ void CoreSessionEventProcessor::processWhoInformation (Network *net, const QStri } +/* ERR_NOSUCHCHANNEL - " :No such channel" */ +void CoreSessionEventProcessor::processIrcEvent403(IrcEventNumeric *e) +{ + // If this is the result of an AutoWho, hide it. It's confusing to show to the user. + if (!checkParamCount(e, 2)) + return; + + QString channelOrNick = e->params()[0]; + // Check if channel name has a who in progress. + // If not, then check if user nick exists and has a who in progress. + if (coreNetwork(e)->isAutoWhoInProgress(channelOrNick)) { + qDebug() << "Channel/nick" << channelOrNick << "no longer exists during AutoWho, ignoring"; + e->setFlag(EventManager::Silent); + } +} + /* ERR_ERRONEUSNICKNAME */ void CoreSessionEventProcessor::processIrcEvent432(IrcEventNumeric *e) { diff --git a/src/core/coresessioneventprocessor.h b/src/core/coresessioneventprocessor.h index 9d5917ec..3a1070d2 100644 --- a/src/core/coresessioneventprocessor.h +++ b/src/core/coresessioneventprocessor.h @@ -91,6 +91,7 @@ public: Q_INVOKABLE void processIrcEvent352(IrcEvent *event); // RPL_WHOREPLY Q_INVOKABLE void processIrcEvent353(IrcEvent *event); // RPL_NAMREPLY Q_INVOKABLE void processIrcEvent354(IrcEvent *event); // RPL_WHOSPCRPL + Q_INVOKABLE void processIrcEvent403(IrcEventNumeric *event); // ERR_NOSUCHCHANNEL Q_INVOKABLE void processIrcEvent432(IrcEventNumeric *event); // ERR_ERRONEUSNICKNAME Q_INVOKABLE void processIrcEvent433(IrcEventNumeric *event); // ERR_NICKNAMEINUSE Q_INVOKABLE void processIrcEvent437(IrcEventNumeric *event); // ERR_UNAVAILRESOURCE