X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_messageflood.cpp;h=9d119b6c37cfc679e52315670acddb443ae7f70e;hb=6de3017e2cda445bfd9e6b460a35eae7fc199148;hp=7323605cb0203c65435d28f6022eb6f08a1ef558;hpb=567142ef7a82175f3141af255bbe70eae22983cc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 7323605cb..9d119b6c3 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -24,6 +24,7 @@ #include "inspircd.h" +#include "modules/exemption.h" /** Holds flood settings and state for mode +f */ @@ -103,12 +104,14 @@ class MsgFlood : public ParamMode > class ModuleMsgFlood : public Module { + CheckExemption::EventProvider exemptionprov; MsgFlood mf; public: ModuleMsgFlood() - : mf(this) + : exemptionprov(this) + , mf(this) { } @@ -121,7 +124,9 @@ class ModuleMsgFlood : public Module if ((!IS_LOCAL(user)) || !dest->IsModeSet(mf)) return MOD_RES_PASSTHRU; - if (ServerInstance->OnCheckExemption(user,dest,"flood") == MOD_RES_ALLOW) + ModResult res; + FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, dest, "flood")); + if (res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; floodsettings *f = mf.ext.get(dest); @@ -150,7 +155,7 @@ class ModuleMsgFlood : public Module return MOD_RES_PASSTHRU; } - void Prioritize() + void Prioritize() CXX11_OVERRIDE { // we want to be after all modules that might deny the message (e.g. m_muteban, m_noctcp, m_blockcolor, etc.) ServerInstance->Modules->SetPriority(this, I_OnUserPreMessage, PRIORITY_LAST);