2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
5 * Copyright (C) 2014, 2016 Attila Molnar <attilamolnar@hush.com>
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.
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
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/>.
25 /** These commands require no parameters, but if there is a parameter it is a server name where the command will be routed to.
27 class ServerTargetCommand : public Command
30 ServerTargetCommand(Module* mod, const std::string& Name)
35 RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
40 class CommandAdmin : public ServerTargetCommand
43 /** Holds the admin's name, for output in
46 std::string AdminName;
48 /** Holds the email address of the admin,
49 * for output in the /ADMIN command.
51 std::string AdminEmail;
53 /** Holds the admin's nickname, for output
54 * in the /ADMIN command
56 std::string AdminNick;
58 /** Constructor for admin.
60 CommandAdmin(Module* parent);
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.
67 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
72 class CommandCommands : public Command
75 /** Constructor for commands.
77 CommandCommands(Module* parent);
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.
84 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
89 class CommandInfo : public ServerTargetCommand
92 /** Constructor for info.
94 CommandInfo(Module* parent);
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.
101 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
106 class CommandModules : public ServerTargetCommand
109 /** Constructor for modules.
111 CommandModules(Module* parent);
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.
118 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
123 class CommandMotd : public ServerTargetCommand
126 ConfigFileCache motds;
128 /** Constructor for motd.
130 CommandMotd(Module* parent);
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.
137 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
142 class CommandTime : public ServerTargetCommand
145 /** Constructor for time.
147 CommandTime(Module* parent);
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.
154 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
159 class CommandVersion : public Command
162 /** Constructor for version.
164 CommandVersion(Module* parent);
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.
171 CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;