]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nickflood.cpp
Use consistent numerics when a mode already exists or doesn't exist.
[user/henk/code/inspircd.git] / src / modules / m_nickflood.cpp
index a4a87f6916d72a9722f7c3089239770593598036..50e2b3d9366a3ed0c456c275acafbaa14d602fab 100644 (file)
@@ -90,12 +90,12 @@ class NickFlood : public ParamMode<NickFlood, SimpleExtItem<nickfloodsettings> >
        {
        }
 
-       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;
                }
 
@@ -105,7 +105,7 @@ class NickFlood : public ParamMode<NickFlood, SimpleExtItem<nickfloodsettings> >
 
                if ((nnicks<1) || (nsecs<1))
                {
-                       source->WriteNumeric(608, channel->name, "Invalid flood parameter");
+                       source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
                        return MODEACTION_DENY;
                }
 
@@ -148,7 +148,7 @@ class ModuleNickFlood : public Module
                        nickfloodsettings *f = nf.ext.get(channel);
                        if (f)
                        {
-                               FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, channel, "nickflood"));
+                               res = CheckExemption::Call(exemptionprov, user, channel, "nickflood");
                                if (res == MOD_RES_ALLOW)
                                        continue;
 
@@ -187,7 +187,7 @@ class ModuleNickFlood : public Module
                        nickfloodsettings *f = nf.ext.get(channel);
                        if (f)
                        {
-                               FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, channel, "nickflood"));
+                               res = CheckExemption::Call(exemptionprov, user, channel, "nickflood");
                                if (res == MOD_RES_ALLOW)
                                        return;