summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ctables.h1
-rw-r--r--src/modules/m_shun.cpp14
2 files changed, 15 insertions, 0 deletions
diff --git a/include/ctables.h b/include/ctables.h
index 45d0b2aff..792f3b9c3 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -146,6 +146,7 @@ class CoreExport CommandBase : public ServiceProvider
/** Retrieves the IRCv3 message tags. */
const ClientProtocol::TagMap& GetTags() const { return tags; }
+ ClientProtocol::TagMap& GetTags() { return tags; }
};
/** Minimum number of parameters command takes
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 */