X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_repeat.cpp;h=a2e9b1f8b7b778f791bcc8f1df2cf145a1cc3f77;hb=da53c17315d3eb0d0177608d306d208bdf05786b;hp=ef62e9ab10bdec3aeb60b1a52bb61d7b05822d6f;hpb=35b70631f0532a5828b04a8e0c02092a285f331a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index ef62e9ab1..a2e9b1f8b 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 { @@ -127,7 +127,7 @@ class RepeatMode : public ParamMode > { } - void OnUnset(User* source, Channel* chan) + void OnUnset(User* source, Channel* chan) CXX11_OVERRIDE { // Unset the per-membership extension when the mode is removed const Channel::MemberMap& users = chan->GetUsers(); @@ -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; } @@ -274,10 +274,10 @@ class RepeatMode : public ParamMode > else settings.Action = ChannelSettings::ACT_KICK; - if ((settings.Lines = ConvToInt(item)) == 0) + if ((settings.Lines = ConvToNum(item)) == 0) return false; - if ((!stream.GetToken(item)) || ((settings.Seconds = InspIRCd::Duration(item)) == 0)) + if ((!stream.GetToken(item)) || !InspIRCd::Duration(item, settings.Seconds) || (settings.Seconds == 0)) // Required parameter missing return false; @@ -286,13 +286,13 @@ class RepeatMode : public ParamMode > if (stream.GetToken(item)) { // There is a diff parameter, see if it's valid (> 0) - if ((settings.Diff = ConvToInt(item)) == 0) + if ((settings.Diff = ConvToNum(item)) == 0) return false; if (stream.GetToken(item)) { // There is a backlog parameter, see if it's valid - if ((settings.Backlog = ConvToInt(item)) == 0) + if ((settings.Backlog = ConvToNum(item)) == 0) return false; // If there are still tokens, then it's invalid because we allow only 4 @@ -316,7 +316,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; } @@ -409,7 +409,7 @@ class RepeatModule : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides the +E channel mode - for blocking of similar messages", VF_COMMON|VF_VENDOR, rm.GetModuleSettings()); + return Version("Provides channel mode +E, blocking of similar messages", VF_COMMON|VF_VENDOR, rm.GetModuleSettings()); } };