diff options
author | Peter Powell <petpow@saberuk.com> | 2019-06-12 21:46:07 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-06-12 21:52:58 +0100 |
commit | 9433e34b2133d8f1e77fea15447ba4d0259a5fb0 (patch) | |
tree | 8e6bb357472f2e39c31c82053a1d02d4b1f7460d /src/modules/m_repeat.cpp | |
parent | 938837af9fe92d0fef811db96a5e9d6bf8e3ae11 (diff) |
Show the mode syntax in ERR_INVALIDMODEPARAM.
Diffstat (limited to 'src/modules/m_repeat.cpp')
-rw-r--r-- | src/modules/m_repeat.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index a2e9b1f8b..57a6edab6 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -125,6 +125,7 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > : ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> >(Creator, "repeat", 'E') , MemberInfoExt("repeat_memb", ExtensionItem::EXT_MEMBERSHIP, Creator) { + syntax = "[~|*]<lines>:<sec>[:<difference>][:<backlog>]"; } void OnUnset(User* source, Channel* chan) CXX11_OVERRIDE @@ -140,15 +141,14 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > ChannelSettings settings; if (!ParseSettings(source, parameter, settings)) { - source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, - "Invalid repeat syntax. Syntax is: [~|*]<lines>:<sec>[:<difference>][:<backlog>]")); + source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; } if ((settings.Backlog > 0) && (settings.Lines > settings.Backlog)) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, - "Invalid repeat syntax. You can't set lines higher than backlog.")); + "You can't set lines higher than backlog.")); return MODEACTION_DENY; } @@ -309,14 +309,14 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > if (ms.MaxLines && settings.Lines > ms.MaxLines) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, InspIRCd::Format( - "Invalid repeat parameter. The line number you specified is too great. Maximum allowed is %u.", ms.MaxLines))); + "The line number you specified is too big. Maximum allowed is %u.", ms.MaxLines))); return false; } if (ms.MaxSecs && settings.Seconds > ms.MaxSecs) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, InspIRCd::Format( - "Invalid repeat parameter. The seconds you specified are too great. Maximum allowed is %u.", ms.MaxSecs))); + "The seconds you specified are too big. Maximum allowed is %u.", ms.MaxSecs))); return false; } @@ -324,10 +324,10 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > { if (ms.MaxDiff == 0) source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, - "Invalid repeat parameter. The server administrator has disabled matching on edit distance.")); + "The server administrator has disabled matching on edit distance.")); else source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, InspIRCd::Format( - "Invalid repeat parameter. The distance you specified is too great. Maximum allowed is %u.", ms.MaxDiff))); + "The distance you specified is too big. Maximum allowed is %u.", ms.MaxDiff))); return false; } @@ -335,10 +335,10 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > { if (ms.MaxBacklog == 0) source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, - "Invalid repeat parameter. The server administrator has disabled backlog matching.")); + "The server administrator has disabled backlog matching.")); else source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, InspIRCd::Format( - "Invalid repeat paramter. The backlog you specified is too great. Maximum allowed is %u.", ms.MaxBacklog))); + "The backlog you specified is too big. Maximum allowed is %u.", ms.MaxBacklog))); return false; } |