summaryrefslogtreecommitdiff
path: root/src/modules/m_ircv3_ctctags.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-04-25 11:31:42 +0100
committerSadie Powell <sadie@witchery.services>2020-05-05 01:49:35 +0100
commit7488b2de62811d7f831e84fb0aeac2345a7f9ee9 (patch)
treeed31fd531583e73a75d79d290e07c80ab4e5fef0 /src/modules/m_ircv3_ctctags.cpp
parent054148247e682c8fbebc21080c5bf2b770a9c671 (diff)
Allow enabling the message-tags cap without client-only tags.
Diffstat (limited to 'src/modules/m_ircv3_ctctags.cpp')
-rw-r--r--src/modules/m_ircv3_ctctags.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp
index 16b71e83e..bf39bb381 100644
--- a/src/modules/m_ircv3_ctctags.cpp
+++ b/src/modules/m_ircv3_ctctags.cpp
@@ -261,6 +261,7 @@ class C2CTags : public ClientProtocol::MessageTagProvider
Cap::Capability& cap;
public:
+ bool allowclientonlytags;
C2CTags(Module* Creator, Cap::Capability& Cap)
: ClientProtocol::MessageTagProvider(Creator)
, cap(Cap)
@@ -271,7 +272,7 @@ class C2CTags : public ClientProtocol::MessageTagProvider
{
// A client-only tag is prefixed with a plus sign (+) and otherwise conforms
// to the format specified in IRCv3.2 tags.
- if (tagname[0] != '+' || tagname.length() < 2)
+ if (tagname[0] != '+' || tagname.length() < 2 || !allowclientonlytags)
return MOD_RES_PASSTHRU;
// If the user is local then we check whether they have the message-tags cap
@@ -323,6 +324,11 @@ class ModuleIRCv3CTCTags
{
}
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+ {
+ c2ctags.allowclientonlytags = ServerInstance->Config->ConfValue("ctctags")->getBool("allowclientonlytags", true);
+ }
+
ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE
{
return CopyClientTags(details.tags_in, details.tags_out);