X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanprotect.cpp;h=2a46f2f17828a1fdfc6c427c64a8a8aab1fa182e;hb=553a8da754c8cd308bad2008018849714e70f9b7;hp=872ff8d7c22b4c99c4e606e93dde60e7bab0ab72;hpb=60b5a882c45cea0d93119e499f6bb5947036abc5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 872ff8d7c..2a46f2f17 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -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 + * Copyright (C) 2006-2009 Robin Burchell + * Copyright (C) 2008 Thomas Stagner + * Copyright (C) 2008 Pippijn van Steenhoven + * Copyright (C) 2004-2008 Craig Edwards + * Copyright (C) 2007 John Brooks + * Copyright (C) 2007 Dennis Friis * - * 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 . */ + #include "inspircd.h" /* $ModDesc: Provides channel modes +a and +q */ @@ -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); }