X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ojoin.cpp;h=d4daf2b6387a8ec94d97e2901bf695cc236443cd;hb=44e89aafb69fb266bdf780d12a31947bfff4e330;hp=38497f1bb640630092337895e5094e3b6e91e9f3;hpb=82a3069c5604a8b815021532ebfcc98cb50c9c7d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 38497f1bb..d4daf2b63 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -1,16 +1,22 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2009-2010 Daniel De Graaf * - * InspIRCd: (C) 2002-2010 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * 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 free but copyrighted software; see - * the file COPYING for details. + * 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 . */ + /* * Written for InspIRCd-1.2 by Taros on the Tel'Laerad M&D Team * @@ -98,7 +104,7 @@ class NetworkPrefix : public ModeHandler { list = true; prefix = NPrefix; - levelrequired = 0xFFFFFFFF; + levelrequired = INT_MAX; m_paramtype = TR_NICK; } @@ -200,27 +206,24 @@ class ModuleOjoin : public Module void OnRehash(User* user) { - ConfigReader Conf; + ConfigTag* Conf = ServerInstance->Config->ConfValue("ojoin"); if (!np) { // This is done on module load only - std::string npre = Conf.ReadValue("ojoin", "prefix", 0); + std::string npre = Conf->getString("prefix"); NPrefix = npre.empty() ? 0 : npre[0]; if (NPrefix && ServerInstance->Modes->FindPrefix(NPrefix)) throw ModuleException("Looks like the +Y prefix you picked for m_ojoin is already in use. Pick another."); } - notice = Conf.ReadFlag("ojoin", "notice", "yes", 0); - op = Conf.ReadFlag("ojoin", "op", "yes", 0); + notice = Conf->getBool("notice", true); + op = Conf->getBool("op", true); } ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason) { - if ((ServerInstance->ULine(source->nick.c_str())) || ServerInstance->ULine(source->server)) - return MOD_RES_PASSTHRU; - // Don't do anything if they're not +Y if (!memb->hasMode('Y')) return MOD_RES_PASSTHRU; @@ -245,7 +248,7 @@ class ModuleOjoin : public Module Version GetVersion() { - return Version("Network Buisness Join", VF_VENDOR); + return Version("Network Business Join", VF_VENDOR); } };