X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodes%2Fcmode_l.cpp;h=154186248db8aead7eabc496a1f2554134b6e35f;hb=fb9b4ec54c4ae7792b8aa6dc41508151d4460c4c;hp=10ff3135ac71c29cb83ec33021ca71af346893e6;hpb=ed351d92cfb70de7c3214195cac286a9607e1606;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp index 10ff3135a..154186248 100644 --- a/src/modes/cmode_l.cpp +++ b/src/modes/cmode_l.cpp @@ -1,14 +1,45 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits + * + * This program is free but copyrighted software; see + * the file COPYING for details. + * + * --------------------------------------------------- + */ + #include "inspircd.h" #include "mode.h" #include "channels.h" #include "users.h" #include "modes/cmode_l.h" -ModeChannelLimit::ModeChannelLimit() : ModeHandler('l', 1, 0, false, MODETYPE_CHANNEL, false) +ModeChannelLimit::ModeChannelLimit(InspIRCd* Instance) : ModeHandler(Instance, 'l', 1, 0, false, MODETYPE_CHANNEL, false) +{ +} + +ModePair ModeChannelLimit::ModeSet(User*, User*, Channel* channel, const std::string ¶meter) +{ + if (channel->limit) + { + return std::make_pair(true, ConvToStr(channel->limit)); + } + else + { + return std::make_pair(false, parameter); + } +} + +bool ModeChannelLimit::CheckTimeStamp(time_t, time_t, const std::string &their_param, const std::string &our_param, Channel*) { + /* When TS is equal, the higher channel limit wins */ + return (atoi(their_param.c_str()) < atoi(our_param.c_str())); } -ModeAction ModeChannelLimit::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) +ModeAction ModeChannelLimit::OnModeChange(User*, User*, Channel* channel, std::string ¶meter, bool adding) { if (adding) {