]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/u_listmode.h
Remove calls to ListModeBase::OnCleanup (deprecated, empty function)
[user/henk/code/inspircd.git] / src / modules / u_listmode.h
index 7e018e55845fc5e425da2a0cceada1d8fb43e752..c6e1f9add129abb98af4e4c131f6ab8246d54140 100644 (file)
@@ -1,16 +1,22 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
  *
- * This program is free but copyrighted software; see
- *         the file COPYING for details.
+ * 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
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #ifndef INSPIRCD_LISTMODE_PROVIDER
 #define INSPIRCD_LISTMODE_PROVIDER
 
@@ -224,6 +230,12 @@ class ListModeBase : public ModeHandler
 
                if (adding)
                {
+                       if (tidy)
+                               ModeParser::CleanMask(parameter);
+
+                       if (parameter.length() > 250)
+                               return MODEACTION_DENY;
+
                        // If there was no list
                        if (!el)
                        {
@@ -232,10 +244,6 @@ class ListModeBase : public ModeHandler
                                extItem.set(channel, el);
                        }
 
-                       // Clean the mask up
-                       if (this->tidy)
-                               ModeParser::CleanMask(parameter);
-
                        // Check if the item already exists in the list
                        for (modelist::iterator it = el->begin(); it != el->end(); it++)
                        {
@@ -257,7 +265,7 @@ class ListModeBase : public ModeHandler
                                {
                                        // We have a pattern matching the channel...
                                        maxsize = el->size();
-                                       if (IS_LOCAL(source) || (maxsize < it->limit))
+                                       if (!IS_LOCAL(source) || (maxsize < it->limit))
                                        {
                                                /* Ok, it *could* be allowed, now give someone subclassing us
                                                 * a chance to validate the parameter.