]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_info/core_info.h
Fix a bunch of weird indentation and spacing issues.
[user/henk/code/inspircd.git] / src / coremods / core_info / core_info.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2018, 2020 Sadie Powell <sadie@witchery.services>
5  *   Copyright (C) 2014, 2016 Attila Molnar <attilamolnar@hush.com>
6  *
7  * This file is part of InspIRCd.  InspIRCd is free software: you can
8  * redistribute it and/or modify it under the terms of the GNU General Public
9  * License as published by the Free Software Foundation, version 2.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20
21 #pragma once
22
23 #include "inspircd.h"
24
25 /** These commands require no parameters, but if there is a parameter it is a server name where the command will be routed to.
26  */
27 class ServerTargetCommand : public Command
28 {
29  public:
30         ServerTargetCommand(Module* mod, const std::string& Name)
31                 : Command(mod, Name)
32         {
33         }
34
35         RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
36 };
37
38 /** Handle /ADMIN.
39  */
40 class CommandAdmin : public ServerTargetCommand
41 {
42  public:
43         /** Holds the admin's name, for output in
44          * the /ADMIN command.
45          */
46         std::string AdminName;
47
48         /** Holds the email address of the admin,
49          * for output in the /ADMIN command.
50          */
51         std::string AdminEmail;
52
53         /** Holds the admin's nickname, for output
54          * in the /ADMIN command
55          */
56         std::string AdminNick;
57
58         /** Constructor for admin.
59          */
60         CommandAdmin(Module* parent);
61
62         /** Handle command.
63          * @param parameters The parameters to the command
64          * @param user The user issuing the command
65          * @return A value from CmdResult to indicate command success or failure.
66          */
67         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
68 };
69
70 /** Handle /COMMANDS.
71  */
72 class CommandCommands : public Command
73 {
74  public:
75         /** Constructor for commands.
76          */
77         CommandCommands(Module* parent);
78
79         /** Handle command.
80          * @param parameters The parameters to the command
81          * @param user The user issuing the command
82          * @return A value from CmdResult to indicate command success or failure.
83          */
84         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
85 };
86
87 /** Handle /INFO.
88  */
89 class CommandInfo : public ServerTargetCommand
90 {
91  public:
92         /** Constructor for info.
93          */
94         CommandInfo(Module* parent);
95
96         /** Handle command.
97          * @param parameters The parameters to the command
98          * @param user The user issuing the command
99          * @return A value from CmdResult to indicate command success or failure.
100          */
101         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
102 };
103
104 /** Handle /MODULES.
105  */
106 class CommandModules : public ServerTargetCommand
107 {
108  public:
109         /** Constructor for modules.
110          */
111         CommandModules(Module* parent);
112
113         /** Handle command.
114          * @param parameters The parameters to the command
115          * @param user The user issuing the command
116          * @return A value from CmdResult to indicate command success or failure.
117          */
118         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
119 };
120
121 /** Handle /MOTD.
122  */
123 class CommandMotd : public ServerTargetCommand
124 {
125  public:
126         ConfigFileCache motds;
127
128         /** Constructor for motd.
129          */
130         CommandMotd(Module* parent);
131
132         /** Handle command.
133          * @param parameters The parameters to the command
134          * @param user The user issuing the command
135          * @return A value from CmdResult to indicate command success or failure.
136          */
137         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
138 };
139
140 class CommandServList : public SplitCommand
141 {
142  private:
143         UserModeReference invisiblemode;
144
145  public:
146         CommandServList(Module* parent);
147         CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
148 };
149
150 /** Handle /TIME.
151  */
152 class CommandTime : public ServerTargetCommand
153 {
154  public:
155         /** Constructor for time.
156          */
157         CommandTime(Module* parent);
158
159         /** Handle command.
160          * @param parameters The parameters to the command
161          * @param user The user issuing the command
162          * @return A value from CmdResult to indicate command success or failure.
163          */
164         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
165 };
166
167 /** Handle /VERSION.
168  */
169 class CommandVersion : public Command
170 {
171  public:
172         /** Constructor for version.
173          */
174         CommandVersion(Module* parent);
175
176         /** Handle command.
177          * @param parameters The parameters to the command
178          * @param user The user issuing the command
179          * @return A value from CmdResult to indicate command success or failure.
180          */
181         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
182 };