From 7488b2de62811d7f831e84fb0aeac2345a7f9ee9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 25 Apr 2020 11:31:42 +0100 Subject: Allow enabling the message-tags cap without client-only tags. --- src/modules/m_ircv3_ctctags.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/modules') 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); -- cgit v1.3.1-10-gc9f91