X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nopartmsg.cpp;h=be01fa6c01cac38d84142558c5079c883b7f6d86;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=51ee659cd6fb665faf467a5c982ca1714bb344fa;hpb=b5965b08c23e3e89404b481386f2e56ce7cb7ce2;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nopartmsg.cpp b/src/modules/m_nopartmsg.cpp index 51ee659cd..be01fa6c0 100644 --- a/src/modules/m_nopartmsg.cpp +++ b/src/modules/m_nopartmsg.cpp @@ -1,32 +1,33 @@ -/* +------------------------------------+ - * | 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) 2008 Robin Burchell * - * 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 extban +b p: - part message bans */ class ModulePartMsgBan : public Module { - private: public: - ModulePartMsgBan() + void init() { Implementation eventlist[] = { I_OnUserPart, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 2); - } - - virtual ~ModulePartMsgBan() - { + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } virtual Version GetVersion() @@ -34,24 +35,19 @@ class ModulePartMsgBan : public Module return Version("Implements extban +b p: - part message bans", VF_OPTCOMMON|VF_VENDOR); } - virtual void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts) { if (!IS_LOCAL(memb->user)) return; if (memb->chan->GetExtBanStatus(memb->user, 'p') == MOD_RES_DENY) - partmessage = ""; - - return; + partmessage.clear(); } - virtual void On005Numeric(std::string &output) + virtual void On005Numeric(std::map& tokens) { - ServerInstance->AddExtBanChar('p'); + tokens["EXTBAN"].push_back('p'); } }; - MODULE_INIT(ModulePartMsgBan) -