]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_info/core_info.h
08aab4cd1cc8ba06f71e95ea216f246c8248560a
[user/henk/code/inspircd.git] / src / coremods / core_info / core_info.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2018 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 /** Handle /TIME.
141  */
142 class CommandTime : public ServerTargetCommand
143 {
144  public:
145         /** Constructor for time.
146          */
147         CommandTime(Module* parent);
148
149         /** Handle command.
150          * @param parameters The parameters to the command
151          * @param user The user issuing the command
152          * @return A value from CmdResult to indicate command success or failure.
153          */
154         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
155 };
156
157 /** Handle /VERSION.
158  */
159 class CommandVersion : public Command
160 {
161  public:
162         /** Constructor for version.
163          */
164         CommandVersion(Module* parent);
165
166         /** Handle command.
167          * @param parameters The parameters to the command
168          * @param user The user issuing the command
169          * @return A value from CmdResult to indicate command success or failure.
170          */
171         CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
172 };