]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_cban.cpp
Initiial revision of CBAN. It doesn't do anything useful just yet.
[user/henk/code/inspircd.git] / src / modules / m_cban.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *     
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 using namespace std;
18
19 #include <stdio.h>
20 #include "users.h"
21 #include "channels.h"
22 #include "modules.h"
23 #include "helperfuncs.h"
24
25 /* $ModDesc: Gives /cban, aka C:lines. Think Q:lines, for channels. */
26
27 Server *Srv;
28
29 class cmd_cban : public command_t
30 {
31         public:
32         cmd_cban () : command_t("CBAN",'o',2)
33         {
34                 this->source = "m_cban.so";
35         }
36
37         void Handle(char **parameters, int pcnt, userrec *user)
38         {
39                 /* Handle CBAN here. */
40         }
41 };
42
43 class ModuleCBan : public Module
44 {
45         cmd_cban* mycommand;
46         public:
47                 ModuleCBan(Server* Me) : Module::Module(Me)
48                 {
49                         Srv = Me;
50                         mycommand = new cmd_cban();
51                         Srv->AddCommand(mycommand);
52                 }
53
54         virtual int OnUserPreJoin (userrec *user, chanrec *chan, const char *cname)
55         {
56                 /* check cbans in here, and apply as necessary. */
57
58                 /* Allow the change. */
59                 return 0;
60         }
61
62         virtual ~ModuleCBan()
63         {
64         }
65         
66         virtual Version GetVersion()
67         {
68                 return Version(1,0,0,0,VF_VENDOR);
69         }
70 };
71
72
73 class ModuleCBanFactory : public ModuleFactory
74 {
75  public:
76         ModuleCBanFactory()
77         {
78         }
79         
80         ~ModuleCBanFactory()
81         {
82         }
83         
84         virtual Module * CreateModule(Server* Me)
85         {
86                 return new ModuleCBan(Me);
87         }
88         
89 };
90
91
92 extern "C" void * init_module( void )
93 {
94         return new ModuleCBanFactory;
95 }
96