From 8be79c0797a8b12fc1990c09da275bc6f20a9c03 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 17 Nov 2019 22:23:51 +0000 Subject: Make rehashing messages more consistent. --- src/coremods/core_oper/cmd_rehash.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/coremods/core_oper/cmd_rehash.cpp b/src/coremods/core_oper/cmd_rehash.cpp index e234e54b4..6d09a3a84 100644 --- a/src/coremods/core_oper/cmd_rehash.cpp +++ b/src/coremods/core_oper/cmd_rehash.cpp @@ -64,13 +64,10 @@ CmdResult CommandRehash::Handle(User* user, const Params& parameters) // Rehash for me. Try to start the rehash thread if (!ServerInstance->ConfigThread) { - 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, FileSystem::GetFileName(ServerInstance->ConfigFileName), "Rehashing"); - else - ServerInstance->PI->SendUserNotice(user, "*** Rehashing server " + FileSystem::GetFileName(ServerInstance->ConfigFileName)); + const std::string configfile = FileSystem::GetFileName(ServerInstance->ConfigFileName); + user->WriteRemoteNumeric(RPL_REHASHING, configfile, "Rehashing " + ServerInstance->Config->ServerName); + ServerInstance->SNO->WriteGlobalSno('a', "%s is rehashing %s on %s", user->nick.c_str(), + configfile.c_str(), ServerInstance->Config->ServerName.c_str()); /* Don't do anything with the logs here -- logs are restarted * after the config thread has completed. @@ -83,10 +80,7 @@ CmdResult CommandRehash::Handle(User* user, const Params& parameters) * A rehash is already in progress! ahh shit. * 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->WriteNotice("*** Could not rehash: A rehash is already in progress."); - else - ServerInstance->PI->SendUserNotice(user, "*** Could not rehash: A rehash is already in progress."); + user->WriteRemoteNotice("*** Could not rehash: A rehash is already in progress."); } // Always return success so spanningtree forwards an incoming REHASH even if we failed -- cgit v1.2.3