X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_noctcp.cpp;h=0b4e39764151486e9b12d9a1318cd2abd5689a66;hb=9539fa9d7bcb19100bd5b7f67d6f792e48fff909;hp=0dc004ee8489c9b190c377d4cc875b40ca3ef882;hpb=86775e2e98f55b3b88befe2daff0ca23f02f3155;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 0dc004ee8..0b4e39764 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -1,16 +1,24 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2007-2008 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2004, 2006 Craig Edwards * - * 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 support for unreal-style channel mode +C */ @@ -18,7 +26,7 @@ class NoCTCP : public ModeHandler { public: - NoCTCP(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'C', 0, 0, false, MODETYPE_CHANNEL, false) { } + NoCTCP(Module* Creator) : ModeHandler(Creator, "noctcp", 'C', PARAM_NONE, MODETYPE_CHANNEL) { } ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { @@ -50,8 +58,8 @@ class ModuleNoCTCP : public Module public: - ModuleNoCTCP(InspIRCd* Me) - : Module(Me), nc(Me, this) + ModuleNoCTCP() + : nc(this) { if (!ServerInstance->Modes->AddMode(&nc)) throw ModuleException("Could not add new modes!"); @@ -61,12 +69,11 @@ class ModuleNoCTCP : public Module virtual ~ModuleNoCTCP() { - ServerInstance->Modes->DelMode(&nc); } virtual Version GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("Provides support for unreal-style channel mode +C", VF_VENDOR); } virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) @@ -79,11 +86,10 @@ class ModuleNoCTCP : public Module if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user))) { Channel* c = (Channel*)dest; + ModResult res = ServerInstance->OnCheckExemption(user,c,"noctcp"); - if (CHANOPS_EXEMPT(ServerInstance, 'C') && c->GetStatus(user) == STATUS_OP) - { + if (res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; - } if (!c->GetExtBanStatus(user, 'C').check(!c->IsModeSet('C'))) {