IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix());
if (ircuser) {
- QString newAccount = e->params().at(0);
- // WHOX uses '0' to indicate logged-out, account-notify uses '*'
- if (newAccount != "*") {
- // Account logged in, set account name
- ircuser->setAccount(newAccount);
- } else {
- // Account logged out, set account name to logged-out
- ircuser->setAccount("*");
- }
+ // WHOX uses '0' to indicate logged-out, account-notify and extended-join uses '*'.
+ // As '*' is used internally to represent logged-out, no need to handle that differently.
+ ircuser->setAccount(e->params().at(0));
} else {
qDebug() << "Received account-notify data for unknown user" << e->prefix();
}
}
}
-
+/* JOIN: ":<nick!user@host> JOIN <channel>" */
void CoreSessionEventProcessor::processIrcEventJoin(IrcEvent *e)
{
if (e->testFlag(EventManager::Fake)) // generated by handleEarlyNetsplitJoin
IrcUser *ircuser = net->updateNickFromMask(e->prefix());
if (net->capEnabled(IrcCap::EXTENDED_JOIN)) {
- if (!checkParamCount(e, 3))
- return;
- // If logged in, :nick!user@host JOIN #channelname accountname :Real Name
- // If logged out, :nick!user@host JOIN #channelname * :Real Name
- // See: http://ircv3.net/specs/extensions/extended-join-3.1.html
- // FIXME Keep track of authed user account, requires adding support to ircuser.h/cpp
- ircuser->setRealName(e->params()[2]);
+ if (e->params().count() < 3) {
+ // Some IRC servers don't send extended-join events in all situations. Rather than
+ // ignore the join entirely, treat it as a regular join with a debug-level log entry.
+ // See: https://github.com/inspircd/inspircd/issues/821
+ qDebug() << "extended-join requires 3 params, got:" << e->params() << ", handling as a "
+ "regular join";
+ } else {
+ // If logged in, :nick!user@host JOIN #channelname accountname :Real Name
+ // If logged out, :nick!user@host JOIN #channelname * :Real Name
+ // See: http://ircv3.net/specs/extensions/extended-join-3.1.html
+ // WHOX uses '0' to indicate logged-out, account-notify and extended-join uses '*'.
+ // As '*' is used internally to represent logged-out, no need to handle that differently.
+ ircuser->setAccount(e->params()[1]);
+ // Update the user's real name, too
+ ircuser->setRealName(e->params()[2]);
+ }
}
// Else :nick!user@host JOIN #channelname
{
QString param = e->params().count() ? e->params().first() : QString();
// FIXME use events
- coreNetwork(e)->putRawLine("PONG " + coreNetwork(e)->serverEncode(param));
+ // Take priority so this won't get stuck behind other queued messages.
+ coreNetwork(e)->putRawLine("PONG " + coreNetwork(e)->serverEncode(param), true);
}
}
-/* RPL_WHOISACCOUNT: "<nick> <account> :is authed as */
+/* RPL_WHOISACCOUNT - "<nick> <account> :is authed as" */
void CoreSessionEventProcessor::processIrcEvent330(IrcEvent *e)
{
if (!checkParamCount(e, 3))
// Don't use .section(" ", 1) with WHOX replies, for there's no hopcount to trim out
// As part of IRCv3 account-notify, check account name
- // WHOX uses '0' to indicate logged-out, account-notify uses '*'
+ // WHOX uses '0' to indicate logged-out, account-notify and extended-join uses '*'.
QString newAccount = e->params()[7];
if (newAccount != "0") {
// Account logged in, set account name
}
+/* ERR_NOSUCHCHANNEL - "<channel name> :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)
{