X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_noctcp.cpp;h=4fc844b74851f9c29edb21c2a9ee0fd04cd9b102;hb=d23c030c9a8fd58807438245a004e4aa5b7288ba;hp=6be3d79afb26cb63b2f8ee01b770a12f4de329e4;hpb=992674362c5f64bdb8e1942eeaa7612524529cd6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 6be3d79af..4fc844b74 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -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; } }