diff options
author | Sadie Powell <sadie@witchery.services> | 2021-01-19 07:19:48 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2021-01-19 07:19:48 +0000 |
commit | 28fef58b882e34369c935d56cb4ac50429cba8c7 (patch) | |
tree | d63802c899c7d1cadbf1890a70db07750f82de4c /src/coremods | |
parent | 5fe9da839cc387244f9d34aececd6aa28f551c90 (diff) |
Send ERR_CANTUNLOADMODULE when unloading a module on reload fails.
Diffstat (limited to 'src/coremods')
-rw-r--r-- | src/coremods/core_reloadmodule.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/coremods/core_reloadmodule.cpp b/src/coremods/core_reloadmodule.cpp index 98bf2ab40..34eaeae18 100644 --- a/src/coremods/core_reloadmodule.cpp +++ b/src/coremods/core_reloadmodule.cpp @@ -736,7 +736,10 @@ class ReloadAction : public ActionBase ServerInstance->SNO->WriteGlobalSno('a', "RELOAD MODULE: %s %ssuccessfully reloaded", passedname.c_str(), result ? "" : "un"); User* user = ServerInstance->FindUUID(uuid); if (user) - user->WriteNumeric(RPL_LOADEDMODULE, passedname, InspIRCd::Format("Module %ssuccessfully reloaded.", (result ? "" : "un"))); + { + int numeric = result ? RPL_LOADEDMODULE : ERR_CANTUNLOADMODULE; + user->WriteNumeric(numeric, passedname, InspIRCd::Format("Module %ssuccessfully reloaded.", (result ? "" : "un"))); + } ServerInstance->GlobalCulls.AddItem(this); } @@ -747,7 +750,7 @@ CmdResult CommandReloadmodule::Handle(User* user, const Params& parameters) Module* m = ServerInstance->Modules->Find(parameters[0]); if (m == creator) { - user->WriteNumeric(RPL_LOADEDMODULE, parameters[0], "You cannot reload core_reloadmodule (unload and load it)"); + user->WriteNumeric(ERR_CANTUNLOADMODULE, parameters[0], "You cannot reload core_reloadmodule (unload and load it)"); return CMD_FAILURE; } @@ -761,7 +764,7 @@ CmdResult CommandReloadmodule::Handle(User* user, const Params& parameters) } else { - user->WriteNumeric(RPL_LOADEDMODULE, parameters[0], "Could not find module by that name"); + user->WriteNumeric(ERR_CANTUNLOADMODULE, parameters[0], "Could not find module by that name"); return CMD_FAILURE; } } |