summaryrefslogtreecommitdiff
path: root/src/commands/cmd_rehash.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/cmd_rehash.cpp')
-rw-r--r--src/commands/cmd_rehash.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/commands/cmd_rehash.cpp b/src/commands/cmd_rehash.cpp
index abf0b7876..07183ec7d 100644
--- a/src/commands/cmd_rehash.cpp
+++ b/src/commands/cmd_rehash.cpp
@@ -45,7 +45,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
{
std::string param = parameters.size() ? parameters[0] : "";
- FOREACH_MOD(I_OnPreRehash,OnPreRehash(user, param));
+ FOREACH_MOD(OnPreRehash, (user, param));
if (param.empty())
{
@@ -68,32 +68,25 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
if (param[0] == '-')
param = param.substr(1);
- FOREACH_MOD(I_OnModuleRehash,OnModuleRehash(user, param));
+ FOREACH_MOD(OnModuleRehash, (user, param));
return CMD_SUCCESS;
}
// Rehash for me. Try to start the rehash thread
if (!ServerInstance->ConfigThread)
{
- std::string m = user->nick + " is rehashing config file " + ServerConfig::CleanFilename(ServerInstance->ConfigFileName.c_str()) + " on " + ServerInstance->Config->ServerName;
+ std::string m = user->nick + " is rehashing config file " + FileSystem::GetFileName(ServerInstance->ConfigFileName) + " on " + ServerInstance->Config->ServerName;
ServerInstance->SNO->WriteGlobalSno('a', m);
if (IS_LOCAL(user))
- user->WriteNumeric(RPL_REHASHING, "%s %s :Rehashing",
- user->nick.c_str(),ServerConfig::CleanFilename(ServerInstance->ConfigFileName.c_str()));
+ user->WriteNumeric(RPL_REHASHING, "%s :Rehashing", FileSystem::GetFileName(ServerInstance->ConfigFileName).c_str());
else
- ServerInstance->PI->SendUserNotice(user, std::string("*** Rehashing server ") +
- ServerConfig::CleanFilename(ServerInstance->ConfigFileName.c_str()));
+ ServerInstance->PI->SendUserNotice(user, "*** Rehashing server " + FileSystem::GetFileName(ServerInstance->ConfigFileName));
/* Don't do anything with the logs here -- logs are restarted
* after the config thread has completed.
*/
- ServerInstance->RehashUsersAndChans();
- FOREACH_MOD(I_OnGarbageCollect, OnGarbageCollect());
-
-
- ServerInstance->ConfigThread = new ConfigReaderThread(user->uuid);
- ServerInstance->Threads->Start(ServerInstance->ConfigThread);
+ ServerInstance->Rehash(user->uuid);
}
else
{
@@ -102,7 +95,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use
* XXX, todo: we should find some way to kill runaway rehashes that are blocking, this is a major problem for unrealircd users
*/
if (IS_LOCAL(user))
- user->WriteServ("NOTICE %s :*** Could not rehash: A rehash is already in progress.", user->nick.c_str());
+ user->WriteNotice("*** Could not rehash: A rehash is already in progress.");
else
ServerInstance->PI->SendUserNotice(user, "*** Could not rehash: A rehash is already in progress.");
}