1 /***************************************************************************
2 * Copyright (C) 2005-2020 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
24 #include <QStringList>
26 // Why a namespace instead of a class? Seems to be a better fit for C++ than a 'static' class, as
27 // compared to C# or Java. However, feel free to change if needed.
28 // See https://stackoverflow.com/questions/482745/namespaces-for-enum-types-best-practices
30 * IRCv3 capability names and values
34 // NOTE: If you add or modify the constants below, update the knownCaps list.
37 * Account change notification.
39 * http://ircv3.net/specs/extensions/account-notify-3.1.html
41 const QString ACCOUNT_NOTIFY = "account-notify";
44 * Magic number for WHOX, used to ignore user-requested WHOX replies from servers
46 * If a user initiates a WHOX, there's no easy way to tell what fields were requested. It's
47 * simpler to not attempt to parse data from user-requested WHOX replies.
49 const uint ACCOUNT_NOTIFY_WHOX_NUM = 369;
52 * Send account information as a tag with all commands sent by a user.
54 * http://ircv3.net/specs/extensions/account-notify-3.1.html
56 const QString ACCOUNT_TAG = "account-tag";
59 * Away change notification.
61 * http://ircv3.net/specs/extensions/away-notify-3.1.html
63 const QString AWAY_NOTIFY = "away-notify";
66 * Capability added/removed notification.
68 * This is implicitly enabled via CAP LS 302, and is here for servers that only partially
71 * http://ircv3.net/specs/extensions/cap-notify-3.2.html
73 const QString CAP_NOTIFY = "cap-notify";
76 * Hostname/user changed notification.
78 * http://ircv3.net/specs/extensions/chghost-3.2.html
80 const QString CHGHOST = "chghost";
83 * Extended join information.
85 * http://ircv3.net/specs/extensions/extended-join-3.1.html
87 const QString EXTENDED_JOIN = "extended-join";
90 * Additional metadata on a per-message basis
92 * https://ircv3.net/specs/extensions/message-tags
94 const QString MESSAGE_TAGS = "message-tags";
97 * Multiple mode prefixes in MODE and WHO replies.
99 * http://ircv3.net/specs/extensions/multi-prefix-3.1.html
101 const QString MULTI_PREFIX = "multi-prefix";
104 * SASL authentication.
106 * http://ircv3.net/specs/extensions/sasl-3.2.html
108 const QString SASL = "sasl";
111 * Allows updating realname without reconnecting
113 * https://ircv3.net/specs/extensions/setname
115 const QString SETNAME = "setname";
118 * Userhost in names replies.
120 * http://ircv3.net/specs/extensions/userhost-in-names-3.2.html
122 const QString USERHOST_IN_NAMES = "userhost-in-names";
125 * Server time for messages.
127 * https://ircv3.net/specs/extensions/server-time-3.2.html
129 const QString SERVER_TIME = "server-time";
132 * Vendor-specific capabilities
137 * Twitch.tv membership message support
139 * User list in a channel can be quite large and often non required for bot users and is then optional.
141 * From Twitch.tv documentation:
142 * "Adds membership state event data. By default, we do not send this data to clients without this capability."
144 * https://dev.twitch.tv/docs/v5/guides/irc/#twitch-irc-capability-membership
146 const QString TWITCH_MEMBERSHIP = "twitch.tv/membership";
149 * Self message support, as recognized by ZNC.
151 * Some servers (e.g. Bitlbee) assume self-message support; ZNC requires a capability
152 * instead. As self-message is already implemented, there's little reason to not do this.
154 * More information in the IRCv3 commit that removed the 'self-message' capability.
156 * https://github.com/ircv3/ircv3-specifications/commit/1bfba47843c2526707c902034b3395af934713c8
158 const QString ZNC_SELF_MESSAGE = "znc.in/self-message";
162 * List of capabilities currently implemented and requested during capability negotiation.
164 const QStringList knownCaps = QStringList{ACCOUNT_NOTIFY,
176 Vendor::TWITCH_MEMBERSHIP,
177 Vendor::ZNC_SELF_MESSAGE};
178 // NOTE: If you modify the knownCaps list, update the constants above as needed.
181 * SASL authentication mechanisms
183 * http://ircv3.net/specs/extensions/sasl-3.1.html
187 * PLAIN authentication, e.g. hashed password
189 const QString PLAIN = "PLAIN";
192 * EXTERNAL authentication, e.g. SSL certificate and keys
194 const QString EXTERNAL = "EXTERNAL";