#include "inspircd.h"
#include "listmode.h"
+#include "modules/exemption.h"
/** Handles channel mode +g
*/
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");
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");
}
class ModuleChanFilter : public Module
{
+ CheckExemption::EventProvider exemptionprov;
ChanFilter cf;
bool hidemask;
public:
ModuleChanFilter()
- : cf(this)
+ : exemptionprov(this)
+ , cf(this)
{
}
return MOD_RES_PASSTHRU;
Channel* chan = static_cast<Channel*>(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;