X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fcmode_l.cpp;h=d61b2597b40444da2574c176796293ee784c0402;hb=3b78613576364c4ac6a4e4af43a2eea056c8dd3f;hp=f057a75e6f000b12570569c50396a57e0f73f3b9;hpb=1bf6cf727da706d821bc4cf84055e27be5ed7f7c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp index f057a75e6..d61b2597b 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,17 @@ 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()); - + int limit = ConvToInt(parameter); if (limit < 0) - return false; + return MODEACTION_DENY; + + ext.set(chan, limit); + return MODEACTION_ALLOW; +} - parameter = ConvToStr(limit); - return true; +void ModeChannelLimit::SerializeParam(Channel* chan, intptr_t n, std::string& out) +{ + out += ConvToStr(n); }