]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/mode.cpp
mlock: handle case where no mlock has been set on a channel yet
[user/henk/code/inspircd.git] / src / mode.cpp
index a632ab516916f02cf4b37d44a26c90ea64a388aa..5efc98250d7e1851b93d88cce54d6a900e1e6145 100644 (file)
@@ -1,16 +1,27 @@
-/*       +------------------------------------+
- *       | 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-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2007, 2009 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2006-2008 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
+ *   Copyright (C) 2004-2008 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2006 Oliver Lupton <oliverlupton@gmail.com>
  *
- * 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/>.
  */
 
+
 #include "inspircd.h"
 #include "inspstring.h"
 
@@ -61,8 +72,6 @@ CullResult ModeHandler::cull()
 
 ModeHandler::~ModeHandler()
 {
-       if (ServerInstance && ServerInstance->Modes && ServerInstance->Modes->FindMode(mode, m_type) == this)
-               ServerInstance->Logs->Log("MODE", DEFAULT, "ERROR: Destructor for mode %c called while still registered", mode);
 }
 
 bool ModeHandler::IsListMode()
@@ -265,6 +274,10 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool
        ModeHandler *mh = FindMode(modechar, type);
        int pcnt = mh->GetNumParams(adding);
 
+       // crop mode parameter size to 250 characters
+       if (parameter.length() > 250 && adding)
+               parameter = parameter.substr(0, 250);
+
        ModResult MOD_RESULT;
        FIRST_MOD_RESULT(OnRawMode, MOD_RESULT, (user, chan, modechar, parameter, adding, pcnt));