#include "inspircd.h"
+#include "modules/exemption.h"
// The number of seconds nickname changing will be blocked for.
static unsigned int duration;
{
}
- ModeAction OnSet(User* source, Channel* channel, std::string& parameter)
+ ModeAction OnSet(User* source, Channel* channel, std::string& parameter) CXX11_OVERRIDE
{
std::string::size_type colon = parameter.find(':');
if ((colon == std::string::npos) || (parameter.find('-') != std::string::npos))
{
- source->WriteNumeric(608, channel->name, "Invalid flood parameter");
+ source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
return MODEACTION_DENY;
}
if ((nnicks<1) || (nsecs<1))
{
- source->WriteNumeric(608, channel->name, "Invalid flood parameter");
+ source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
return MODEACTION_DENY;
}
class ModuleNickFlood : public Module
{
+ CheckExemption::EventProvider exemptionprov;
NickFlood nf;
public:
ModuleNickFlood()
- : nf(this)
+ : exemptionprov(this)
+ , nf(this)
{
}
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
- res = ServerInstance->OnCheckExemption(user,channel,"nickflood");
+ res = CheckExemption::Call(exemptionprov, user, channel, "nickflood");
if (res == MOD_RES_ALLOW)
continue;
nickfloodsettings *f = nf.ext.get(channel);
if (f)
{
- res = ServerInstance->OnCheckExemption(user,channel,"nickflood");
+ res = CheckExemption::Call(exemptionprov, user, channel, "nickflood");
if (res == MOD_RES_ALLOW)
return;