core: Implement account-tag
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 21 Jul 2020 01:56:39 +0000 (21:56 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 28 Nov 2020 12:42:31 +0000 (13:42 +0100)
commitd778861aa194578cd90e019b64fe285ea58746c4
tree6c424342db9b64570d247aec1967cdfb75eb9ae7
parent30269231603184696da66adf4503440062df8962
core: Implement account-tag

Implement the "account-tag" capability, updating IrcUser account
status with information from the "account" tag when available.
According to the specification, "account" will be sent with all
user-initiated commands when logged in, and will NOT be sent when
logged out.

Quassel takes a conservative approach combining the approaches taken
by other clients.  For PRIVMSG and NOTICE, "account" tag is used to
set whether the IrcUser is logged in if present, AND logged out if NOT
present.  For all other messages, if the "account" tag is present and
the prefix refers to an EXISTING IrcUser, the IrcUser will be set as
logged in, but will NOT be set as logged out if the tag is missing.

Server/client details as of 2020-7-20
* Oragono (server)
Sends account tag with any client-initiated command
https://github.com/oragono/oragono/blob/b5855e61941e4dc33b64f6d61996a23686136166/irc/client.go#L1474

* InspIRCd (server)
Sends account tag with any client-initiated command
https://github.com/inspircd/inspircd/blob/4a6fedd9324d87349a806c9c1d0ae6e7d3c1fd38/src/modules/m_ircv3_accounttag.cpp

* BitBot (client/bot)
Marks as logged in, does not handle logging out
https://github.com/jesopo/bitbot/blob/9dfbe3723c8af97c9fbd35a3391298bf6f641043/src/core_modules/permissions/__init__.py#L117-L121

* PIRC.pl web client (client)
Marks as logged in, does not handle logging out
https://github.com/pirc-pl/pirc-gateway/blob/63d7be177568e99cada61cb53f1176b857bfca72/js/gateway_def.js#L2605-L2607

* KiwiIRC (client)
Marks as logged in AND logged out via PRIVMSG, NOTICE, WALLOPS, ignores other commands
https://github.com/kiwiirc/irc-framework/blob/11e9e8141dbbff68d730d2d840454949d2b2b5f5/src/commands/handlers/messaging.js#L9-L139

See https://ircv3.net/specs/extensions/account-tag-3.2
src/common/irccap.h
src/common/irctags.h
src/core/ircparser.cpp