mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 19:19:02 -04:00
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11757 e03df62e-2008-0410-955e-edbf42e46eb7
58 lines
1.2 KiB
C++
58 lines
1.2 KiB
C++
/* +------------------------------------+
|
|
* | Inspire Internet Relay Chat Daemon |
|
|
* +------------------------------------+
|
|
*
|
|
* InspIRCd: (C) 2002-2009 InspIRCd Development Team
|
|
* See: http://wiki.inspircd.org/Credits
|
|
*
|
|
* This program is free but copyrighted software; see
|
|
* the file COPYING for details.
|
|
*
|
|
* ---------------------------------------------------
|
|
*/
|
|
|
|
#include "inspircd.h"
|
|
|
|
/* $ModDesc: Implements extban +b p: - part message bans */
|
|
|
|
class ModulePartMsgBan : public Module
|
|
{
|
|
private:
|
|
public:
|
|
ModulePartMsgBan(InspIRCd* Me) : Module(Me)
|
|
{
|
|
Implementation eventlist[] = { I_OnUserPart, I_On005Numeric };
|
|
ServerInstance->Modules->Attach(eventlist, this, 2);
|
|
}
|
|
|
|
virtual ~ModulePartMsgBan()
|
|
{
|
|
}
|
|
|
|
virtual Version GetVersion()
|
|
{
|
|
return Version("Implements extban +b p: - part message bans", VF_COMMON|VF_VENDOR, API_VERSION);
|
|
}
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
virtual void On005Numeric(std::string &output)
|
|
{
|
|
ServerInstance->AddExtBanChar('p');
|
|
}
|
|
};
|
|
|
|
|
|
MODULE_INIT(ModulePartMsgBan)
|
|
|