summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0x277F <0x277F@gmail.com>2016-07-22 04:12:05 -0600
committerAttila Molnar <attilamolnar@hush.com>2016-07-22 12:12:05 +0200
commitc8602a49931e31593efefa45f141a06ce8e9a90f (patch)
tree78e7a7caf7b1c65a867aa63df3e4be73c047d31f
parentaa2fa90c57b43c76f60721fb7d60d1ed46a6a916 (diff)
stripcolor now strips from part messages (#1175)
-rw-r--r--src/modules/m_stripcolor.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 0d4bdb877..592aeda90 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -83,6 +83,23 @@ class ModuleStripColor : public Module
return MOD_RES_PASSTHRU;
}
+ void OnUserPart(Membership* memb, std::string& partmessage, CUList& except_list) CXX11_OVERRIDE
+ {
+ User* user = memb->user;
+ Channel* channel = memb->chan;
+
+ if (!IS_LOCAL(user))
+ return;
+
+ bool active = channel->GetExtBanStatus(user, 'S').check(!user->IsModeSet(csc))
+ && ServerInstance->OnCheckExemption(user, channel, "stripcolor") != MOD_RES_ALLOW;
+
+ if (active)
+ {
+ InspIRCd::StripColor(partmessage);
+ }
+ }
+
Version GetVersion() CXX11_OVERRIDE
{
return Version("Provides channel +S mode (strip ansi color)", VF_VENDOR);