#include "inspircd.h"
-
-class NoCTCP : public SimpleChannelModeHandler
-{
- public:
- NoCTCP(Module* Creator) : SimpleChannelModeHandler(Creator, "noctcp", 'C') { }
-};
+#include "modules/exemption.h"
class ModuleNoCTCP : public Module
{
- NoCTCP nc;
+ CheckExemption::EventProvider exemptionprov;
+ SimpleChannelModeHandler nc;
public:
ModuleNoCTCP()
- : nc(this)
+ : exemptionprov(this)
+ , nc(this, "noctcp", 'C')
{
}
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;