From: Shane Synan Date: Wed, 17 Feb 2016 19:51:23 +0000 (-0600) Subject: Add support for userhost-in-names capability X-Git-Tag: travis-deploy-test~513^2~2 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=8afb9857fdd184412b3d43e4402c3dda102ca4c5 Add support for userhost-in-names capability Add support for userhost-in-names, which, if enabled, allows getting the user/hostname information of a channel without using WHO polling. See http://ircv3.net/specs/extensions/userhost-in-names-3.2.html --- diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index cc41309b..e3ef9457 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -168,6 +168,15 @@ public: */ inline bool useCapExtendedJoin() const { return capEnabled("extended-join"); } + /** + * Gets the status of the userhost-in-names capability. + * + * http://ircv3.net/specs/extensions/userhost-in-names-3.2.html + * + * @returns True if userhost-in-names is enabled, otherwise false + */ + inline bool useCapUserhostInNames() const { return capEnabled("userhost-in-names"); } + public slots: virtual void setMyNick(const QString &mynick); diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index 0cee2444..ca9b92df 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -193,7 +193,8 @@ void CoreSessionEventProcessor::processIrcEventCap(IrcEvent *e) queueCurrentCap = true; } else if (availableCapPair.at(0).startsWith("away-notify") || availableCapPair.at(0).startsWith("account-notify") || - availableCapPair.at(0).startsWith("extended-join")) { + availableCapPair.at(0).startsWith("extended-join") || + availableCapPair.at(0).startsWith("userhost-in-names")) { // Always request these capabilities if available queueCurrentCap = true; } @@ -959,6 +960,11 @@ void CoreSessionEventProcessor::processIrcEvent353(IrcEvent *e) nick = nick.mid(1); } + // If userhost-in-names capability is enabled, the following will be + // in the form "nick!user@host" rather than "nick". This works without + // special handling as the following use nickFromHost() as needed. + // See: http://ircv3.net/specs/extensions/userhost-in-names-3.2.html + nicks << nick; modes << mode; }