summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/conf/modules.conf.example5
-rw-r--r--src/modules/m_ircv3_ctctags.cpp8
2 files changed, 12 insertions, 1 deletions
diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example
index 85180d78d..09d997b32 100644
--- a/docs/conf/modules.conf.example
+++ b/docs/conf/modules.conf.example
@@ -1180,6 +1180,11 @@
# extension which allows clients to add extra data to their messages.
# This is used to support new IRCv3 features such as replies and ids.
#<module name="ircv3_ctctags">
+#
+# If you want to only allow client tags that are intended for processing
+# by the server you can disable the following setting. Doing this is not
+# recommended though as it may break clients.
+#<ctctags allowclientonlytags="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# IRCv3 echo-message module: Provides the echo-message IRCv3
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);