summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-09-27 03:26:38 +0100
committerSadie Powell <sadie@witchery.services>2020-09-27 11:37:22 +0100
commite79d4ec07dfb7ecb8b54926906bd2c53a8061e37 (patch)
tree478dfb3172365ff5d3d42368608f47ca12726510 /src
parentb52e957bcf6a0ecadfd1785783a3c163093871f8 (diff)
Make shun block client-only tags by default.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_shun.cpp14
1 files changed, 14 insertions, 0 deletions
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<std::string, irc::insensitive_swo> 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 */