]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/coremods/core_oper/cmd_rehash.cpp
Fix some oversights
[user/henk/code/inspircd.git] / src / coremods / core_oper / cmd_rehash.cpp
index f71219f7561729f5cdbead9efed86dcd59798c98..19d2fa8c20260657c5a05b7e5c68971a5d3d0686 100644 (file)
 
 
 #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)
 {
@@ -62,7 +55,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
 
                // 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;
@@ -99,6 +92,3 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
        // Always return success so spanningtree forwards an incoming REHASH even if we failed
        return CMD_SUCCESS;
 }
-
-
-COMMAND_INIT(CommandRehash)