X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanfilter.cpp;h=133c5180dd10338730378e333d20b0e0438053fb;hb=4aa27e75af8da0a5bc2e35f931f0165339f5f289;hp=a7bc215570c221e54e6419ff2a623d55b8d99c33;hpb=c0aba5b728b0a921d95ec120aa638dab1520b42f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index a7bc21557..133c5180d 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -25,6 +25,7 @@ #include "inspircd.h" #include "listmode.h" +#include "modules/exemption.h" /** Handles channel mode +g */ @@ -33,8 +34,7 @@ class ChanFilter : public ListModeBase public: ChanFilter(Module* Creator) : ListModeBase(Creator, "filter", 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { } - bool ValidateParam(User* user, Channel* chan, std::string &word) - { + bool ValidateParam(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { if (word.length() > 35) { user->WriteNumeric(935, chan->name, word, "%word is too long for censor list"); @@ -44,17 +44,17 @@ class ChanFilter : public ListModeBase return true; } - void TellListTooLong(User* user, Channel* chan, std::string &word) + void TellListTooLong(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { user->WriteNumeric(939, chan->name, word, "Channel spamfilter list is full"); } - void TellAlreadyOnList(User* user, Channel* chan, std::string &word) + void TellAlreadyOnList(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { user->WriteNumeric(937, chan->name, InspIRCd::Format("The word %s is already on the spamfilter list", word.c_str())); } - void TellNotSet(User* user, Channel* chan, std::string &word) + void TellNotSet(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { user->WriteNumeric(938, chan->name, "No such spamfilter word is set"); } @@ -62,13 +62,15 @@ class ChanFilter : public ListModeBase class ModuleChanFilter : public Module { + CheckExemption::EventProvider exemptionprov; ChanFilter cf; bool hidemask; public: ModuleChanFilter() - : cf(this) + : exemptionprov(this) + , cf(this) { } @@ -84,7 +86,7 @@ class ModuleChanFilter : public Module return MOD_RES_PASSTHRU; Channel* chan = static_cast(dest); - ModResult res = ServerInstance->OnCheckExemption(user,chan,"filter"); + ModResult res = CheckExemption::Call(exemptionprov, user, chan, "filter"); if (!IS_LOCAL(user) || res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU;