]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_operinvex.cpp
Remove InspIRCd* parameters and fields
[user/henk/code/inspircd.git] / src / modules / m_operinvex.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 #include "u_listmode.h"
16
17 /* $ModDep: ../../include/u_listmode.h */
18
19 /* $ModDesc: Implements extban/invex +I O: - opertype bans */
20
21 class ModuleOperInvex : public Module
22 {
23  private:
24  public:
25         ModuleOperInvex()       {
26                 Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
27                 ServerInstance->Modules->Attach(eventlist, this, 2);
28         }
29
30         ~ModuleOperInvex()
31         {
32         }
33
34         Version GetVersion()
35         {
36                 return Version("ExtBan 'O' - oper type ban", VF_COMMON|VF_VENDOR);
37         }
38
39         ModResult OnCheckBan(User *user, Channel *c, const std::string& mask)
40         {
41                 if (mask[0] == 'O' && mask[1] == ':')
42                 {
43                         if (IS_OPER(user) && InspIRCd::Match(user->oper, mask.substr(2)))
44                                 return MOD_RES_DENY;
45                 }
46                 return MOD_RES_PASSTHRU;
47         }
48
49         virtual void On005Numeric(std::string &output)
50         {
51                 ServerInstance->AddExtBanChar('O');
52         }
53 };
54
55
56 MODULE_INIT(ModuleOperInvex)
57