summaryrefslogtreecommitdiff
path: root/src/modules/m_stripcolor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_stripcolor.cpp')
-rw-r--r--src/modules/m_stripcolor.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 6ea279422..a309492eb 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -47,20 +47,27 @@ class ModuleStripColor : public Module
return MOD_RES_PASSTHRU;
bool active = false;
- if (target.type == MessageTarget::TYPE_USER)
+ switch (target.type)
{
- User* t = target.Get<User>();
- active = t->IsModeSet(usc);
- }
- else if (target.type == MessageTarget::TYPE_CHANNEL)
- {
- Channel* t = target.Get<Channel>();
- ModResult res = CheckExemption::Call(exemptionprov, user, t, "stripcolor");
-
- if (res == MOD_RES_ALLOW)
- return MOD_RES_PASSTHRU;
-
- active = !t->GetExtBanStatus(user, 'S').check(!t->IsModeSet(csc));
+ case MessageTarget::TYPE_USER:
+ {
+ User* t = target.Get<User>();
+ active = t->IsModeSet(usc);
+ break;
+ }
+ case MessageTarget::TYPE_CHANNEL:
+ {
+ Channel* t = target.Get<Channel>();
+ ModResult res = CheckExemption::Call(exemptionprov, user, t, "stripcolor");
+
+ if (res == MOD_RES_ALLOW)
+ return MOD_RES_PASSTHRU;
+
+ active = !t->GetExtBanStatus(user, 'S').check(!t->IsModeSet(csc));
+ break;
+ }
+ case MessageTarget::TYPE_SERVER:
+ break;
}
if (active)