diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-11-26 13:36:44 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-11-26 13:36:44 +0100 |
commit | c290d09c454324614a93039364fe62a7b7b75cbb (patch) | |
tree | 6c68b27d78629dfe5fa8c5aa41b760e2e9e44b40 /src/modules | |
parent | bbc6a0bbbe7475e5e1d0c4f2418c6fe6e0e952b7 (diff) |
Handle module reloading in core_reloadmodule entirely
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_globalload.cpp | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index a3f3242f0..294187fa5 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -116,25 +116,6 @@ class CommandGunloadmodule : public Command } }; -class GReloadModuleWorker : public HandlerBase1<void, bool> -{ - public: - const std::string nick; - const std::string name; - const std::string uid; - GReloadModuleWorker(const std::string& usernick, const std::string& uuid, const std::string& modn) - : nick(usernick), name(modn), uid(uuid) {} - void Call(bool result) - { - ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY RELOADED BY '%s'%s", name.c_str(), nick.c_str(), result ? "" : " (failed here)"); - User* user = ServerInstance->FindNick(uid); - if (user) - user->WriteNumeric(RPL_LOADEDMODULE, "%s :Module %ssuccessfully reloaded.", - name.c_str(), result ? "" : "un"); - ServerInstance->GlobalCulls.AddItem(this); - } -}; - /** Handle /GRELOADMODULE */ class CommandGreloadmodule : public Command @@ -154,10 +135,8 @@ class CommandGreloadmodule : public Command Module* m = ServerInstance->Modules->Find(parameters[0]); if (m) { - GReloadModuleWorker* worker = NULL; - if ((m != creator) && (!creator->dying)) - worker = new GReloadModuleWorker(user->nick, user->uuid, parameters[0]); - ServerInstance->Modules->Reload(m, worker); + ServerInstance->SNO->WriteToSnoMask('a', "MODULE '%s' GLOBALLY RELOADED BY '%s'", parameters[0].c_str(), user->nick.c_str()); + ServerInstance->Parser.CallHandler("RELOADMODULE", parameters, user); } else { |