X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_repeat.cpp;h=89df1814c06daed3b85203f80d88f96ea37f2a98;hb=b4599531f97a9e6207b6bb8d728d7523b6995523;hp=bd42061662a1ba2b9dd1a89e97a1a46a57295857;hpb=8ec9a73a91ad1c7009fd3055fbad7c980b5e1732;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index bd4206166..89df1814c 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -34,7 +34,7 @@ class ChannelSettings unsigned int Backlog; unsigned int Lines; unsigned int Diff; - unsigned int Seconds; + unsigned long Seconds; void serialize(std::string& out) const { @@ -141,14 +141,14 @@ class RepeatMode : public ParamMode > if (!ParseSettings(source, parameter, settings)) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, - "Invalid repeat syntax. Syntax is {[~*]}[lines]:[time]{:[difference]}{:[backlog]}.")); + "Invalid repeat syntax. Syntax is: [~|*]:[:][:]")); 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 needed lines higher than backlog.")); + "Invalid repeat syntax. You can't set lines higher than backlog.")); return MODEACTION_DENY; } @@ -277,7 +277,10 @@ class RepeatMode : public ParamMode > if ((settings.Lines = ConvToNum(item)) == 0) return false; - if ((!stream.GetToken(item)) || ((settings.Seconds = InspIRCd::Duration(item)) == 0)) + if (!InspIRCd::Duration(item, settings.Seconds)) + return false; + + if ((!stream.GetToken(item)) || (settings.Seconds == 0)) // Required parameter missing return false; @@ -316,7 +319,7 @@ class RepeatMode : public ParamMode > if (ms.MaxSecs && settings.Seconds > ms.MaxSecs) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter, InspIRCd::Format( - "Invalid repeat parameter. The seconds you specified is too great. Maximum allowed is %u.", ms.MaxSecs))); + "Invalid repeat parameter. The seconds you specified are too great. Maximum allowed is %u.", ms.MaxSecs))); return false; }