]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_noctcp.cpp
Merge branch 'insp20' into master.
[user/henk/code/inspircd.git] / src / modules / m_noctcp.cpp
index 9dd9bf852d25e1dd3da1e4ed88079ad2f1aba315..e9733cf543699ef4730fde4d663f32ad6851a408 100644 (file)
 #include "inspircd.h"
 #include "modules/exemption.h"
 
-class NoCTCP : public SimpleChannelModeHandler
-{
- public:
-       NoCTCP(Module* Creator) : SimpleChannelModeHandler(Creator, "noctcp", 'C') { }
-};
-
 class ModuleNoCTCP : public Module
 {
        CheckExemption::EventProvider exemptionprov;
-       NoCTCP nc;
+       SimpleChannelModeHandler nc;
 
  public:
        ModuleNoCTCP()
                : exemptionprov(this)
-               , nc(this)
+               , nc(this, "noctcp", 'C')
        {
        }
 
@@ -50,11 +44,10 @@ 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;
-                       FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, c, "noctcp"));
+                       ModResult res = CheckExemption::Call(exemptionprov, user, c, "noctcp");
                        if (res == MOD_RES_ALLOW)
                                return MOD_RES_PASSTHRU;