Add support for cap account-tag

The account-tag capability is now requested when ZNC connects to an IRC server, the same is then offered to clients connecting.
This permits the tag to then pass through to account-tag aware clients.
This commit is contained in:
NuclearW
2020-08-02 23:26:17 -04:00
parent 276ff8e42c
commit c79961c514
3 changed files with 12 additions and 0 deletions
+8
View File
@@ -107,6 +107,7 @@ class CClient : public CIRCSocket {
m_bCapNotify(false),
m_bAwayNotify(false),
m_bAccountNotify(false),
m_bAccountTag(false),
m_bExtendedJoin(false),
m_bNamesx(false),
m_bUHNames(false),
@@ -148,6 +149,11 @@ class CClient : public CIRCSocket {
{true, [this](bool bVal) { m_bAwayNotify = bVal; }}},
{"account-notify",
{true, [this](bool bVal) { m_bAccountNotify = bVal; }}},
{"account-tag",
{true, [this](bool bVal) {
m_bAccountTag = bVal;
SetTagSupport("account", bVal);
}}},
{"extended-join",
{true, [this](bool bVal) { m_bExtendedJoin = bVal; }}},
}) {
@@ -178,6 +184,7 @@ class CClient : public CIRCSocket {
bool HasCapNotify() const { return m_bCapNotify; }
bool HasAwayNotify() const { return m_bAwayNotify; }
bool HasAccountNotify() const { return m_bAccountNotify; }
bool HasAccountTag() const { return m_bAccountTag; }
bool HasExtendedJoin() const { return m_bExtendedJoin; }
bool HasNamesx() const { return m_bNamesx; }
bool HasUHNames() const { return m_bUHNames; }
@@ -346,6 +353,7 @@ class CClient : public CIRCSocket {
bool m_bCapNotify;
bool m_bAwayNotify;
bool m_bAccountNotify;
bool m_bAccountTag;
bool m_bExtendedJoin;
bool m_bNamesx;
bool m_bUHNames;
+2
View File
@@ -150,6 +150,7 @@ class CIRCSock : public CIRCSocket {
bool HasUHNames() const { return m_bUHNames; }
bool HasAwayNotify() const { return m_bAwayNotify; }
bool HasAccountNotify() const { return m_bAccountNotify; }
bool HasAccountTag() const { return m_bAccountTag; }
bool HasExtendedJoin() const { return m_bExtendedJoin; }
bool HasServerTime() const { return m_bServerTime; }
const std::set<char>& GetUserModes() const {
@@ -207,6 +208,7 @@ class CIRCSock : public CIRCSocket {
bool m_bUHNames;
bool m_bAwayNotify;
bool m_bAccountNotify;
bool m_bAccountTag;
bool m_bExtendedJoin;
bool m_bServerTime;
CString m_sPerms;
+2
View File
@@ -67,6 +67,7 @@ CIRCSock::CIRCSock(CIRCNetwork* pNetwork)
m_bUHNames(false),
m_bAwayNotify(false),
m_bAccountNotify(false),
m_bAccountTag(false),
m_bExtendedJoin(false),
m_bServerTime(false),
m_sPerms("*!@%+"),
@@ -376,6 +377,7 @@ bool CIRCSock::OnCapabilityMessage(CMessage& Message) {
{"userhost-in-names", [this](bool bVal) { m_bUHNames = bVal; }},
{"away-notify", [this](bool bVal) { m_bAwayNotify = bVal; }},
{"account-notify", [this](bool bVal) { m_bAccountNotify = bVal; }},
{"account-tag", [this](bool bVal) { m_bAccountTag = bVal; }},
{"extended-join", [this](bool bVal) { m_bExtendedJoin = bVal; }},
{"server-time", [this](bool bVal) { m_bServerTime = bVal; }},
{"znc.in/server-time-iso",