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