#include "inspircd.h"
+#include "core_oper.h"
-/** Handle /REHASH.
- */
-class CommandRehash : public Command
+CommandRehash::CommandRehash(Module* parent)
+ : Command(parent, "REHASH", 0)
{
- public:
- /** Constructor for rehash.
- */
- CommandRehash ( Module* parent) : Command(parent,"REHASH",0) { flags_needed = 'o'; Penalty = 2; syntax = "[<servermask>]"; }
- /** Handle command.
- * @param parameters The parameters to the command
- * @param user The user issuing the command
- * @return A value from CmdResult to indicate command success or failure.
- */
- CmdResult Handle(const std::vector<std::string>& parameters, User *user);
-};
+ flags_needed = 'o';
+ Penalty = 2;
+ syntax = "[<servermask>]";
+}
CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, User *user)
{
// the leading "-" is optional; remove it if present.
if (param[0] == '-')
- param = param.substr(1);
+ param.erase(param.begin());
FOREACH_MOD(OnModuleRehash, (user, param));
return CMD_SUCCESS;
ServerInstance->SNO->WriteGlobalSno('a', m);
if (IS_LOCAL(user))
- user->WriteNumeric(RPL_REHASHING, "%s :Rehashing", FileSystem::GetFileName(ServerInstance->ConfigFileName).c_str());
+ user->WriteNumeric(RPL_REHASHING, FileSystem::GetFileName(ServerInstance->ConfigFileName), "Rehashing");
else
ServerInstance->PI->SendUserNotice(user, "*** Rehashing server " + FileSystem::GetFileName(ServerInstance->ConfigFileName));
// Always return success so spanningtree forwards an incoming REHASH even if we failed
return CMD_SUCCESS;
}
-
-
-COMMAND_INIT(CommandRehash)