X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fcmode_l.cpp;h=9121d64ec83521ed9891ec1b3a92ef8636f21af4;hb=b9006ce3cba742ca2a22d601ba1a63a47b0402c9;hp=f057a75e6f000b12570569c50396a57e0f73f3b9;hpb=8790551dc182cd8804ee7d8ef89ccb31067cc2a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp index f057a75e6..9121d64ec 100644 --- a/src/modes/cmode_l.cpp +++ b/src/modes/cmode_l.cpp @@ -20,12 +20,10 @@ #include "inspircd.h" -#include "mode.h" -#include "channels.h" -#include "users.h" #include "builtinmodes.h" -ModeChannelLimit::ModeChannelLimit() : ParamChannelModeHandler(NULL, "limit", 'l') +ModeChannelLimit::ModeChannelLimit() + : ParamMode(NULL, "limit", 'l') { } @@ -35,13 +33,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 ¶meter) +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); }