]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modes/cmode_b.cpp
m_spanningtree Call the collision handler with the proper parameter (client ip instea...
[user/henk/code/inspircd.git] / src / modes / cmode_b.cpp
index 5fcebfde961ff2c43043c40a78c1e1322bea7018..660b0c27559a5cac64975b70a1a32270ec3046bb 100644 (file)
@@ -1,16 +1,23 @@
-/*       +------------------------------------+
- *       | 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) 2007 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2006 Craig Edwards <craigedwards@brainbox.cc>
  *
- * 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 <string>
 #include <vector>
@@ -105,11 +112,11 @@ std::string& ModeChannelBan::AddBan(User *user, std::string &dest, Channel *chan
        /* Attempt to tidy the mask */
        ModeParser::CleanMask(dest);
        /* If the mask was invalid, we exit */
-       if (dest == "")
+       if (dest == "" || dest.length() > 250)
                return dest;
 
        long maxbans = chan->GetMaxBans();
-       if (!IS_LOCAL(user) && ((unsigned)chan->bans.size() > (unsigned)maxbans))
+       if (IS_LOCAL(user) && ((unsigned)chan->bans.size() > (unsigned)maxbans))
        {
                user->WriteServ("478 %s %s :Channel ban list for %s is full (maximum entries for this channel is %ld)",user->nick.c_str(), chan->name.c_str(), chan->name.c_str(), maxbans);
                dest = "";
@@ -150,9 +157,6 @@ std::string& ModeChannelBan::DelBan(User *user, std::string& dest, Channel *chan
                return dest;
        }
 
-       /* 'Clean' the mask, e.g. nick -> nick!*@* */
-       ModeParser::CleanMask(dest);
-
        for (BanList::iterator i = chan->bans.begin(); i != chan->bans.end(); i++)
        {
                if (!strcasecmp(i->data.c_str(), dest.c_str()))