]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_noctcp.cpp
Merge tag 'v2.0.25' into master.
[user/henk/code/inspircd.git] / src / modules / m_noctcp.cpp
index 6be3d79afb26cb63b2f8ee01b770a12f4de329e4..4fc844b74851f9c29edb21c2a9ee0fd04cd9b102 100644 (file)
@@ -20,6 +20,7 @@
 
 
 #include "inspircd.h"
+#include "modules/exemption.h"
 
 class NoCTCP : public SimpleChannelModeHandler
 {
@@ -29,11 +30,13 @@ class NoCTCP : public SimpleChannelModeHandler
 
 class ModuleNoCTCP : public Module
 {
+       CheckExemption::EventProvider exemptionprov;
        NoCTCP nc;
 
  public:
        ModuleNoCTCP()
-               : nc(this)
+               : exemptionprov(this)
+               , nc(this)
        {
        }
 
@@ -47,16 +50,16 @@ class ModuleNoCTCP : public Module
                if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
                {
                        Channel* c = (Channel*)dest;
-                       if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ",8)))
+                       if ((text.empty()) || (text[0] != '\001') || (!strncmp(text.c_str(),"\1ACTION ", 8)) || (text == "\1ACTION\1") || (text == "\1ACTION"))
                                return MOD_RES_PASSTHRU;
 
-                       ModResult res = ServerInstance->OnCheckExemption(user,c,"noctcp");
+                       ModResult res = CheckExemption::Call(exemptionprov, user, c, "noctcp");
                        if (res == MOD_RES_ALLOW)
                                return MOD_RES_PASSTHRU;
 
                        if (!c->GetExtBanStatus(user, 'C').check(!c->IsModeSet(nc)))
                        {
-                               user->WriteNumeric(ERR_NOCTCPALLOWED, "%s %s :Can't send CTCP to channel (+C set)",user->nick.c_str(), c->name.c_str());
+                               user->WriteNumeric(ERR_NOCTCPALLOWED, c->name, "Can't send CTCP to channel (+C set)");
                                return MOD_RES_DENY;
                        }
                }