]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_l.cpp
m_passforward: Don't forward password if the connect block required a password to...
[user/henk/code/inspircd.git] / src / modes / cmode_l.cpp
index f057a75e6f000b12570569c50396a57e0f73f3b9..128854b50e94d19931736d9025ddfdfbbcb3d3dc 100644 (file)
@@ -25,7 +25,8 @@
 #include "users.h"
 #include "builtinmodes.h"
 
-ModeChannelLimit::ModeChannelLimit() : ParamChannelModeHandler(NULL, "limit", 'l')
+ModeChannelLimit::ModeChannelLimit()
+       : ParamMode<ModeChannelLimit, LocalIntExt>(NULL, "limit", 'l')
 {
 }
 
@@ -35,13 +36,13 @@ bool ModeChannelLimit::ResolveModeConflict(std::string &their_param, const std::
        return (atoi(their_param.c_str()) < atoi(our_param.c_str()));
 }
 
-bool ModeChannelLimit::ParamValidate(std::string &parameter)
+ModeAction ModeChannelLimit::OnSet(User* user, Channel* chan, std::string& parameter)
 {
-       int limit = atoi(parameter.c_str());
-
-       if (limit < 0)
-               return false;
+       ext.set(chan, ConvToInt(parameter));
+       return MODEACTION_ALLOW;
+}
 
-       parameter = ConvToStr(limit);
-       return true;
+void ModeChannelLimit::SerializeParam(Channel* chan, intptr_t n, std::string& out)
+{
+       out += ConvToStr(n);
 }