X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanprotect.cpp;h=affd0c8d674324649a674af542da9834a85ccf2f;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=caef4961f2dec09a33735aa0fbe9b078af9a4b80;hpb=051749fa68a78e5a6e808f2a7d151788c75f9373;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index caef4961f..affd0c8d6 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 */ @@ -243,19 +255,19 @@ class ModuleChanProtect : public Module ServerInstance->Modules->AddService(cp); Implementation eventlist[] = { I_OnUserPreJoin }; - ServerInstance->Modules->Attach(eventlist, this, 1); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } void LoadSettings() { - ConfigReader Conf; + ConfigTag* tag = ServerInstance->Config->ConfValue("chanprotect"); - settings.FirstInGetsFounder = Conf.ReadFlag("chanprotect", "noservices", 0); + settings.FirstInGetsFounder = tag->getBool("noservices"); - std::string qpre = Conf.ReadValue("chanprotect", "qprefix", 0); + std::string qpre = tag->getString("qprefix"); char QPrefix = qpre.empty() ? 0 : qpre[0]; - std::string apre = Conf.ReadValue("chanprotect", "aprefix", 0); + std::string apre = tag->getString("aprefix"); char APrefix = apre.empty() ? 0 : apre[0]; if ((APrefix && QPrefix) && APrefix == QPrefix) @@ -272,8 +284,8 @@ class ModuleChanProtect : public Module cp.setPrefix(APrefix); cf.setPrefix(QPrefix); } - settings.DeprivSelf = Conf.ReadFlag("chanprotect","deprotectself", "yes", 0); - settings.DeprivOthers = Conf.ReadFlag("chanprotect","deprotectothers", "yes", 0); + settings.DeprivSelf = tag->getBool("deprotectself", true); + settings.DeprivOthers = tag->getBool("deprotectothers", true); } ModResult OnUserPreJoin(User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven)