summaryrefslogtreecommitdiff
path: root/src/modes/cmode_l.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes/cmode_l.cpp')
-rw-r--r--src/modes/cmode_l.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp
index 001d058bb..128854b50 100644
--- a/src/modes/cmode_l.cpp
+++ b/src/modes/cmode_l.cpp
@@ -23,9 +23,10 @@
#include "mode.h"
#include "channels.h"
#include "users.h"
-#include "modes/cmode_l.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);
}