+ if (net->capEnabled(IrcCap::ACCOUNT_TAG) && tags.contains(IrcTags::ACCOUNT)) {
+ // Whenever account-tag is specified, update the relevant IrcUser if it exists
+ // Logged-out status is handled in specific commands (PRIVMSG, NOTICE, etc)
+ //
+ // Don't use "updateNickFromMask" here to ensure this only updates existing IrcUsers and
+ // won't create a new IrcUser. This guards against an IRC server setting "account" tag in
+ // nonsensical places, e.g. for messages that are not user sent.
+ IrcUser* ircuser = net->ircUser(prefix);
+ if (ircuser) {
+ ircuser->setAccount(tags[IrcTags::ACCOUNT]);
+ }
+
+ // NOTE: if "account-tag" is enabled and no "account" tag is sent, the given user isn't
+ // logged in ONLY IF it is a user-initiated command. Quassel follows a mixture of what
+ // other clients do here - only marking as logged out via PRIVMSG/NOTICE, but marking logged
+ // in via any message.
+ //
+ // See https://ircv3.net/specs/extensions/account-tag-3.2
+ }
+