X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_channames.cpp;h=e78171c4af53816bfc1d7c1b6a5865ac4055e89d;hb=5a378e1b08ec69cb57f2e52899a5aa7b7424cc75;hp=f89b6ab009bfae90748e9dc0b96f35f510e83a9e;hpb=78e80c2b15e14210def823252f70400bba02ac41;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp index f89b6ab00..e78171c4a 100644 --- a/src/modules/m_channames.cpp +++ b/src/modules/m_channames.cpp @@ -1,16 +1,22 @@ -/* +------------------------------------+ - * | 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 * - * 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: Implements config tags which allow changing characters allowed in channel names */ @@ -49,12 +55,15 @@ class ModuleChannelNames : public Module bool badchan; public: - ModuleChannelNames() : rememberer(ServerInstance->IsChannel) + ModuleChannelNames() : rememberer(ServerInstance->IsChannel), badchan(false) + { + } + + void init() { ServerInstance->IsChannel = &myhandler; - badchan = false; Implementation eventlist[] = { I_OnRehash, I_OnUserKick }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); } @@ -89,9 +98,9 @@ class ModuleChannelNames : public Module virtual void OnRehash(User* user) { - ConfigReader Conf; - std::string denyToken = Conf.ReadValue("channames", "denyrange", 0); - std::string allowToken = Conf.ReadValue("channames", "allowrange", 0); + ConfigTag* tag = ServerInstance->Config->ConfValue("channames"); + std::string denyToken = tag->getString("denyrange"); + std::string allowToken = tag->getString("allowrange"); allowedmap.set(); irc::portparser denyrange(denyToken, false);