summaryrefslogtreecommitdiff
path: root/src/coremods
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-04-19 19:58:03 +0100
committerSadie Powell <sadie@witchery.services>2021-04-19 19:59:41 +0100
commit9ec004958f2af816fc90f753964338eb19961186 (patch)
treefc59c31fd28302c36a92f6e75cefee547c892753 /src/coremods
parentbde0e7e84668df48afaffda7a52eddc0aca543d3 (diff)
Improve the messages sent when loading/unloading/reloading modules.
Diffstat (limited to 'src/coremods')
-rw-r--r--src/coremods/core_reloadmodule.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/coremods/core_reloadmodule.cpp b/src/coremods/core_reloadmodule.cpp
index ef0b13962..f3299db90 100644
--- a/src/coremods/core_reloadmodule.cpp
+++ b/src/coremods/core_reloadmodule.cpp
@@ -729,16 +729,21 @@ class ReloadAction : public ActionBase
{
Module* newmod = ServerInstance->Modules->Find(name);
datakeeper.Restore(newmod);
+ ServerInstance->SNO->WriteGlobalSno('a', "The %s module was reloaded.", passedname.c_str());
}
else
+ {
datakeeper.Fail();
+ ServerInstance->SNO->WriteGlobalSno('a', "Failed to reload the %s module.", passedname.c_str());
+ }
- ServerInstance->SNO->WriteGlobalSno('a', "RELOAD MODULE: %s %ssuccessfully reloaded", passedname.c_str(), result ? "" : "un");
User* user = ServerInstance->FindUUID(uuid);
if (user)
{
- int numeric = result ? RPL_LOADEDMODULE : ERR_CANTUNLOADMODULE;
- user->WriteNumeric(numeric, passedname, InspIRCd::Format("Module %ssuccessfully reloaded.", (result ? "" : "un")));
+ if (result)
+ user->WriteNumeric(RPL_LOADEDMODULE, passedname, InspIRCd::Format("The %s module was reloaded.", passedname.c_str()));
+ else
+ user->WriteNumeric(ERR_CANTUNLOADMODULE, passedname, InspIRCd::Format("Failed to reload the %s module.", passedname.c_str()));
}
ServerInstance->GlobalCulls.AddItem(this);
@@ -764,7 +769,7 @@ CmdResult CommandReloadmodule::Handle(User* user, const Params& parameters)
}
else
{
- user->WriteNumeric(ERR_CANTUNLOADMODULE, parameters[0], "Could not find module by that name");
+ user->WriteNumeric(ERR_CANTUNLOADMODULE, parameters[0], "Could not find a loaded module by that name");
return CMD_FAILURE;
}
}