From d5a6054948502625d7f0c235f6faaeea58734de5 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 27 Jan 2018 13:05:14 +0000 Subject: Add ERR_INVALIDMODEPARAM for responding to invalid mode params. Currently on invalid modes we do a combination of different things: 1. Send a custom mode-specific numeric (which often collides with other modes). 2. Send a server notice. 3. Do absolutely nothing. This new numeric is a generic way of handling invalid parameters when setting a mode that avoids all of the mistakes of the previous behaviour. --- src/modules/m_messageflood.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/m_messageflood.cpp') diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 36f2c923b..0707e6ae4 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -77,7 +77,7 @@ class MsgFlood : public ParamMode > 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; } @@ -88,7 +88,7 @@ class MsgFlood : public ParamMode > if ((nlines<2) || (nsecs<1)) { - source->WriteNumeric(608, channel->name, "Invalid flood parameter"); + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; } -- cgit v1.3.1-10-gc9f91