summaryrefslogtreecommitdiff
path: root/src/modules/m_messageflood.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-07-27 13:13:16 +0100
committerGitHub <noreply@github.com>2017-07-27 13:13:16 +0100
commitff3b706b2506d7614bce5e54bc88657bd62ebd4d (patch)
treedbfbe3df3df3668f0e1ac531229b4e15ff240754 /src/modules/m_messageflood.cpp
parentbb4aa10ed82612624da45d0c9592ddf7f2f51ab5 (diff)
parent81027f3a0888ac4c8e3fb6ea90081492defce946 (diff)
Merge pull request #1271 from SaberUK/master+exemption
Move the OnCheckExemption hook out of the core.
Diffstat (limited to 'src/modules/m_messageflood.cpp')
-rw-r--r--src/modules/m_messageflood.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index d89de49eb..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<MsgFlood, SimpleExtItem<floodsettings> >
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);