]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modules/m_spanningtree/precommand.cpp
Fix the cloaking module on C++98 compilers.
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / precommand.cpp
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2013, 2018 Sadie Powell <sadie@witchery.services>
5  *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
6  *   Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
7  *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
8  *   Copyright (C) 2007, 2010 Craig Edwards <brain@inspircd.org>
9  *
10  * This file is part of InspIRCd.  InspIRCd is free software: you can
11  * redistribute it and/or modify it under the terms of the GNU General Public
12  * License as published by the Free Software Foundation, version 2.
13  *
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  */
22
23
24 #include "inspircd.h"
25
26 #include "main.h"
27
28 ModResult ModuleSpanningTree::OnPreCommand(std::string &command, CommandBase::Params& parameters, LocalUser *user, bool validated)
29 {
30         /* If the command doesnt appear to be valid, we dont want to mess with it. */
31         if (!validated)
32                 return MOD_RES_PASSTHRU;
33
34         if (command == "CONNECT")
35         {
36                 return this->HandleConnect(parameters,user);
37         }
38         else if (command == "SQUIT")
39         {
40                 return this->HandleSquit(parameters,user);
41         }
42         else if (command == "LINKS")
43         {
44                 this->HandleLinks(parameters,user);
45                 return MOD_RES_DENY;
46         }
47         else if (command == "WHOIS")
48         {
49                 if (parameters.size() > 1)
50                 {
51                         // remote whois
52                         return this->HandleRemoteWhois(parameters,user);
53                 }
54         }
55         else if ((command == "VERSION") && (parameters.size() > 0))
56         {
57                 return this->HandleVersion(parameters,user);
58         }
59         return MOD_RES_PASSTHRU;
60 }