diff options
author | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
commit | 2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch) | |
tree | 36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/os_module.cpp | |
parent | 873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff) |
Allow userless command sources
Diffstat (limited to 'modules/commands/os_module.cpp')
-rw-r--r-- | modules/commands/os_module.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/modules/commands/os_module.cpp b/modules/commands/os_module.cpp index 6d7a5db04..1d3c1d30a 100644 --- a/modules/commands/os_module.cpp +++ b/modules/commands/os_module.cpp @@ -24,13 +24,12 @@ class CommandOSModLoad : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.u; const Anope::string &mname = params[0]; - ModuleReturn status = ModuleManager::LoadModule(mname, u); + ModuleReturn status = ModuleManager::LoadModule(mname, source.GetUser()); if (status == MOD_ERR_OK) { - Log(LOG_ADMIN, u, this) << "to load module " << mname; + Log(LOG_ADMIN, source, this) << "to load module " << mname; source.Reply(_("Module \002%s\002 loaded"), mname.c_str()); } else if (status == MOD_ERR_EXISTS) @@ -62,7 +61,6 @@ class CommandOSModReLoad : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.u; const Anope::string &mname = params[0]; Module *m = ModuleManager::FindModule(mname); @@ -80,7 +78,7 @@ class CommandOSModReLoad : public Command /* Unrecoverable */ bool fatal = m->type == PROTOCOL; - ModuleReturn status = ModuleManager::UnloadModule(m, u); + ModuleReturn status = ModuleManager::UnloadModule(m, source.GetUser()); if (status != MOD_ERR_OK) { @@ -88,10 +86,10 @@ class CommandOSModReLoad : public Command return; } - status = ModuleManager::LoadModule(mname, u); + status = ModuleManager::LoadModule(mname, source.GetUser()); if (status == MOD_ERR_OK) { - Log(LOG_ADMIN, u, this) << "to reload module " << mname; + Log(LOG_ADMIN, source, this) << "to reload module " << mname; source.Reply(_("Module \002%s\002 reloaded"), mname.c_str()); } else @@ -128,7 +126,6 @@ class CommandOSModUnLoad : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - User *u = source.u; const Anope::string &mname = params[0]; Module *m = ModuleManager::FindModule(mname); @@ -146,11 +143,11 @@ class CommandOSModUnLoad : public Command Log() << "Trying to unload module [" << mname << "]"; - ModuleReturn status = ModuleManager::UnloadModule(m, u); + ModuleReturn status = ModuleManager::UnloadModule(m, source.GetUser()); if (status == MOD_ERR_OK) { - Log(LOG_ADMIN, u, this) << "to unload module " << mname; + Log(LOG_ADMIN, source, this) << "to unload module " << mname; source.Reply(_("Module \002%s\002 unloaded"), mname.c_str()); } else |