]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_messageflood.cpp
Move ident lookups to the OnSetUserIP hook.
[user/henk/code/inspircd.git] / src / modules / m_messageflood.cpp
index 36f2c923b6779991bfecb152f8dff02568ddf43b..af976afd5f057b301aaf96d26a5a404ff7513fc9 100644 (file)
@@ -77,18 +77,18 @@ class MsgFlood : public ParamMode<MsgFlood, SimpleExtItem<floodsettings> >
                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;
                }
 
                /* Set up the flood parameters for this channel */
                bool ban = (parameter[0] == '*');
-               unsigned int nlines = ConvToInt(parameter.substr(ban ? 1 : 0, ban ? colon-1 : colon));
-               unsigned int nsecs = ConvToInt(parameter.substr(colon+1));
+               unsigned int nlines = ConvToNum<unsigned int>(parameter.substr(ban ? 1 : 0, ban ? colon-1 : colon));
+               unsigned int nsecs = ConvToNum<unsigned int>(parameter.substr(colon+1));
 
                if ((nlines<2) || (nsecs<1))
                {
-                       source->WriteNumeric(608, channel->name, "Invalid flood parameter");
+                       source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
                        return MODEACTION_DENY;
                }