]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanhistory.cpp
Optimize some behaviour in the core (#1476).
[user/henk/code/inspircd.git] / src / modules / m_chanhistory.cpp
index 4d74b65e00a4bfbefb54523adfa099115d915ab7..5f081d9decbb17a2b26debf16ad4e4f36702453d 100644 (file)
@@ -63,18 +63,25 @@ class HistoryMode : public ParamMode<HistoryMode, SimpleExtItem<HistoryList> >
        {
                std::string::size_type colon = parameter.find(':');
                if (colon == std::string::npos)
+               {
+                       source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
                        return MODEACTION_DENY;
+               }
 
                std::string duration(parameter, colon+1);
                if ((IS_LOCAL(source)) && ((duration.length() > 10) || (!IsValidDuration(duration))))
+               {
+                       source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
                        return MODEACTION_DENY;
+               }
 
                unsigned int len = ConvToInt(parameter.substr(0, colon));
                unsigned int time = InspIRCd::Duration(duration);
-               if (len == 0)
-                       return MODEACTION_DENY;
-               if (len > maxlines && IS_LOCAL(source))
+               if (len == 0 || (len > maxlines && IS_LOCAL(source)))
+               {
+                       source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter));
                        return MODEACTION_DENY;
+               }
                if (len > maxlines)
                        len = maxlines;