]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/precommand.cpp
Remove overrides for ADMIN, STATS, TIME
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / precommand.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2010 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 /* $ModDesc: Provides a spanning tree server link protocol */
15
16 #include "inspircd.h"
17 #include "socket.h"
18 #include "xline.h"
19
20 #include "main.h"
21 #include "utils.h"
22 #include "treeserver.h"
23 #include "treesocket.h"
24
25 /* $ModDep: m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/treesocket.h */
26
27 ModResult ModuleSpanningTree::OnPreCommand(std::string &command, std::vector<std::string>& parameters, LocalUser *user, bool validated, const std::string &original_line)
28 {
29         /* If the command doesnt appear to be valid, we dont want to mess with it. */
30         if (!validated)
31                 return MOD_RES_PASSTHRU;
32
33         if (command == "CONNECT")
34         {
35                 return this->HandleConnect(parameters,user);
36         }
37         else if (command == "SQUIT")
38         {
39                 return this->HandleSquit(parameters,user);
40         }
41         else if (command == "MAP")
42         {
43                 return this->HandleMap(parameters,user) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
44         }
45         else if (command == "LINKS")
46         {
47                 this->HandleLinks(parameters,user);
48                 return MOD_RES_DENY;
49         }
50         else if (command == "WHOIS")
51         {
52                 if (parameters.size() > 1)
53                 {
54                         // remote whois
55                         return this->HandleRemoteWhois(parameters,user);
56                 }
57         }
58         else if ((command == "VERSION") && (parameters.size() > 0))
59         {
60                 this->HandleVersion(parameters,user);
61                 return MOD_RES_DENY;
62         }
63         return MOD_RES_PASSTHRU;
64 }
65