From b53db87e90676f24e454efa57dd2cbea745d53c5 Mon Sep 17 00:00:00 2001 From: Shane Synan Date: Wed, 29 Jun 2016 17:19:44 -0400 Subject: [PATCH] Fix joins for non-spec servers with extended-join Some IRC servers don't always send extended-join data despite capability negotiation. Rather than dropping the join entirely, treat it as a normal join. Fixes missing joins on some networks for host changes. --- src/core/coresessioneventprocessor.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index ae670219..69d75695 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -300,7 +300,7 @@ void CoreSessionEventProcessor::processIrcEventInvite(IrcEvent *e) } } - +/* JOIN: ": JOIN " */ void CoreSessionEventProcessor::processIrcEventJoin(IrcEvent *e) { if (e->testFlag(EventManager::Fake)) // generated by handleEarlyNetsplitJoin @@ -314,13 +314,20 @@ void CoreSessionEventProcessor::processIrcEventJoin(IrcEvent *e) 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 + // FIXME Keep track of authed user account, requires adding support to ircuser.h/cpp + // Update the user's real name, too + ircuser->setRealName(e->params()[2]); + } } // Else :nick!user@host JOIN #channelname -- 2.20.1