X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_channel%2Fcmode_l.cpp;h=5b5b2855469bc0e6efc72014c2ebcd2337ae9ccc;hb=d38595e7e14e7509e744d33df657d50d00cc201f;hp=eb16fd182da50821e6f84c52e0757b730118121f;hpb=98372c3cf2c1455e41c388d822876a4d146ae76d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_channel/cmode_l.cpp b/src/coremods/core_channel/cmode_l.cpp index eb16fd182..5b5b28554 100644 --- a/src/coremods/core_channel/cmode_l.cpp +++ b/src/coremods/core_channel/cmode_l.cpp @@ -1,9 +1,12 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2017, 2019 Sadie Powell + * Copyright (C) 2014 Attila Molnar + * Copyright (C) 2012 Robby * Copyright (C) 2009 Daniel De Graaf * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2006 Craig Edwards + * Copyright (C) 2006, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -24,19 +27,21 @@ ModeChannelLimit::ModeChannelLimit(Module* Creator) : ParamMode(Creator, "limit", 'l') + , minlimit(0) { + syntax = ""; } bool ModeChannelLimit::ResolveModeConflict(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())); + return ConvToNum(their_param) < ConvToNum(our_param); } ModeAction ModeChannelLimit::OnSet(User* user, Channel* chan, std::string& parameter) { - int limit = ConvToInt(parameter); - if (limit < 0) + size_t limit = ConvToNum(parameter); + if (limit < minlimit) return MODEACTION_DENY; ext.set(chan, limit);