]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanprotect.cpp
Merge pull request #215 from attilamolnar/insp20+modfixes
[user/henk/code/inspircd.git] / src / modules / m_chanprotect.cpp
index 62e41416bac806ca5caae0ab4604a124009d83cd..2a46f2f17828a1fdfc6c427c64a8a8aab1fa182e 100644 (file)
@@ -1,16 +1,28 @@
-/*       +------------------------------------+
- *       | 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>
+ *   Copyright (C) 2006-2009 Robin Burchell <robin+git@viroteck.net>
+ *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
+ *   Copyright (C) 2008 Pippijn van Steenhoven <pip88nl@gmail.com>
+ *   Copyright (C) 2004-2008 Craig Edwards <craigedwards@brainbox.cc>
+ *   Copyright (C) 2007 John Brooks <john.brooks@dereferenced.net>
+ *   Copyright (C) 2007 Dennis Friis <peavey@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/>.
  */
 
+
 #include "inspircd.h"
 
 /* $ModDesc: Provides channel modes +a and +q */
@@ -162,7 +174,7 @@ class ChanProtect : public ModeHandler, public FounderProtectBase
 {
  public:
        ChanProtect(Module* Creator)
-               : ModeHandler(Creator, "protected", 'a', PARAM_ALWAYS, MODETYPE_CHANNEL),
+               : ModeHandler(Creator, "admin", 'a', PARAM_ALWAYS, MODETYPE_CHANNEL),
                  FounderProtectBase('a',"protected user", 388, 389)
        {
                ModeHandler::list = true;
@@ -261,14 +273,14 @@ class ModuleChanProtect : public Module
                if ((APrefix && QPrefix) && APrefix == QPrefix)
                        throw ModuleException("What the smeg, why are both your +q and +a prefixes the same character?");
 
-               if (ServerInstance->Modes->FindPrefix(APrefix) && ServerInstance->Modes->FindPrefix(APrefix) != &cp)
-                       throw ModuleException("Looks like the +a prefix you picked for m_chanprotect is already in use. Pick another.");
-
-               if (ServerInstance->Modes->FindPrefix(QPrefix) && ServerInstance->Modes->FindPrefix(QPrefix) != &cf)
-                       throw ModuleException("Looks like the +q prefix you picked for m_chanprotect is already in use. Pick another.");
-
                if (settings.booting)
                {
+                       if (APrefix && ServerInstance->Modes->FindPrefix(APrefix) && ServerInstance->Modes->FindPrefix(APrefix) != &cp)
+                               throw ModuleException("Looks like the +a prefix you picked for m_chanprotect is already in use. Pick another.");
+
+                       if (QPrefix && ServerInstance->Modes->FindPrefix(QPrefix) && ServerInstance->Modes->FindPrefix(QPrefix) != &cf)
+                               throw ModuleException("Looks like the +q prefix you picked for m_chanprotect is already in use. Pick another.");
+
                        cp.setPrefix(APrefix);
                        cf.setPrefix(QPrefix);
                }