1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #include "configreader.h"
20 #include "commands/cmd_rehash.h"
24 extern "C" command_t* init_command(InspIRCd* Instance)
26 return new cmd_rehash(Instance);
29 CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user)
31 user->WriteServ("382 %s %s :Rehashing",user->nick,ServerConfig::CleanFilename(CONFIG_FILE));
32 std::string parameter = "";
33 std::string old_disabled = ServerInstance->Config->DisabledCommands;
36 parameter = parameters[0];
40 ServerInstance->WriteOpers("%s is rehashing config file %s",user->nick,ServerConfig::CleanFilename(CONFIG_FILE));
41 ServerInstance->Config->Read(false,user);
43 if (old_disabled != ServerInstance->Config->DisabledCommands)
44 InitializeDisabledCommands(ServerInstance->Config->DisabledCommands, ServerInstance);
46 FOREACH_MOD(I_OnRehash,OnRehash(parameter));