From e79d4ec07dfb7ecb8b54926906bd2c53a8061e37 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 27 Sep 2020 03:26:38 +0100 Subject: Make shun block client-only tags by default. --- src/modules/m_shun.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/modules') diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 4e7d979d1..6be91ce67 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -156,6 +156,7 @@ class ModuleShun : public Module, public Stats::EventListener ShunFactory shun; insp::flat_set enabledcommands; bool affectopers; + bool allowtags; bool notifyuser; bool IsShunned(LocalUser* user) @@ -215,6 +216,7 @@ class ModuleShun : public Module, public Stats::EventListener enabledcommands.insert(enabledcmd); affectopers = tag->getBool("affectopers", false); + allowtags = tag->getBool("allowtags"); notifyuser = tag->getBool("notifyuser", true); } @@ -230,6 +232,18 @@ class ModuleShun : public Module, public Stats::EventListener return MOD_RES_DENY; } + if (!allowtags) + { + // Remove all client tags. + ClientProtocol::TagMap& tags = parameters.GetTags(); + for (ClientProtocol::TagMap::iterator tag = tags.begin(); tag != tags.end(); ) + { + if (tag->first[0] == '+') + tag = tags.erase(tag); + else + tag++; + } + } if (command == "QUIT") { /* Allow QUIT but dont show any quit message */ -- cgit v1.3.1-10-gc9f91