]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_nopartmsg.cpp
Fix compilation of SQL modules, use GlobalCulls to clean up deleted modules
[user/henk/code/inspircd.git] / src / modules / m_nopartmsg.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
6  * See: http://wiki.inspircd.org/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15
16 /* $ModDesc: Implements extban +b p: - part message bans */
17
18 class ModulePartMsgBan : public Module
19 {
20  private:
21  public:
22         ModulePartMsgBan()      {
23                 Implementation eventlist[] = { I_OnUserPart, I_On005Numeric };
24                 ServerInstance->Modules->Attach(eventlist, this, 2);
25         }
26
27         virtual ~ModulePartMsgBan()
28         {
29         }
30
31         virtual Version GetVersion()
32         {
33                 return Version("Implements extban +b p: - part message bans", VF_COMMON|VF_VENDOR, API_VERSION);
34         }
35
36
37         virtual void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
38         {
39                 if (!IS_LOCAL(memb->user))
40                         return;
41
42                 if (memb->chan->GetExtBanStatus(memb->user, 'p') == MOD_RES_DENY)
43                         partmessage = "";
44
45                 return;
46         }
47
48         virtual void On005Numeric(std::string &output)
49         {
50                 ServerInstance->AddExtBanChar('p');
51         }
52 };
53
54
55 MODULE_INIT(ModulePartMsgBan)
56