]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_serverban.cpp
241ac1ce3236a5cb04805035b310f65fa9f1f794
[user/henk/code/inspircd.git] / src / modules / m_serverban.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 s: - server name bans */
17
18 class ModuleServerBan : public Module
19 {
20  private:
21  public:
22         ModuleServerBan(InspIRCd* Me) : Module(Me)
23         {
24                 Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
25                 ServerInstance->Modules->Attach(eventlist, this, 2);
26         }
27
28         virtual ~ModuleServerBan()
29         {
30         }
31
32         virtual Version GetVersion()
33         {
34                 return Version("$Id$",VF_COMMON|VF_VENDOR,API_VERSION);
35         }
36
37         virtual int OnCheckBan(User *user, Channel *c)
38         {
39                 return c->GetExtBanStatus(user->server, 's');
40         }
41
42         virtual void On005Numeric(std::string &output)
43         {
44                 ServerInstance->AddExtBanChar('s');
45         }
46 };
47
48
49 MODULE_INIT(ModuleServerBan)
50