diff options
| author | 2018-01-27 13:05:14 +0000 | |
|---|---|---|
| committer | 2018-01-29 11:52:13 +0000 | |
| commit | d5a6054948502625d7f0c235f6faaeea58734de5 (patch) | |
| tree | a43e95ded07dca92c9d3659e331a88cb8e0b7b21 /src/modules/m_joinflood.cpp | |
| parent | Improve performance under load of OnDataReady and remove C-isms. (diff) | |
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.
Diffstat (limited to 'src/modules/m_joinflood.cpp')
| -rw-r--r-- | src/modules/m_joinflood.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index b4a8f6181..bd9e0ad9e 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -98,7 +98,7 @@ class JoinFlood : public ParamMode<JoinFlood, SimpleExtItem<joinfloodsettings> > 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; } @@ -107,7 +107,7 @@ class JoinFlood : public ParamMode<JoinFlood, SimpleExtItem<joinfloodsettings> > unsigned int nsecs = ConvToInt(parameter.substr(colon+1)); if ((njoins<1) || (nsecs<1)) { - source->WriteNumeric(608, channel->name, "Invalid flood parameter"); + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; } |
