]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modes/cmode_l.cpp
...because every now and again, i have to do a massive commit.
[user/henk/code/inspircd.git] / src / modes / cmode_l.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "mode.h"
16 #include "channels.h"
17 #include "users.h"
18 #include "modes/cmode_l.h"
19
20 ModeChannelLimit::ModeChannelLimit() : ParamChannelModeHandler(NULL, "limit", 'l')
21 {
22 }
23
24 bool ModeChannelLimit::ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel*)
25 {
26         /* When TS is equal, the higher channel limit wins */
27         return (atoi(their_param.c_str()) < atoi(our_param.c_str()));
28 }
29
30 bool ModeChannelLimit::ParamValidate(std::string &parameter)
31 {
32         int limit = atoi(parameter.c_str());
33
34         if (limit < 0)
35                 return false;
36
37         parameter = ConvToStr(limit);
38         return true;
39 }