diff options
author | Adam <Adam@anope.org> | 2011-04-28 22:44:34 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-05-16 04:09:32 -0400 |
commit | 583954d3a1db658281a9afb7b7dd6773726c8c11 (patch) | |
tree | 6a00865d5738c6d0bc42efb35f3f468c5876eb3e /modules/core/os_modreload.cpp | |
parent | 8fb1604f649bec6f356770daf5df6bb8ab811bbf (diff) |
Use module type to determine what type each module is instead of its location in the configuration file.
Diffstat (limited to 'modules/core/os_modreload.cpp')
-rw-r--r-- | modules/core/os_modreload.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/modules/core/os_modreload.cpp b/modules/core/os_modreload.cpp index e721f76a9..4eb14348e 100644 --- a/modules/core/os_modreload.cpp +++ b/modules/core/os_modreload.cpp @@ -27,20 +27,14 @@ class CommandOSModReLoad : public Command User *u = source.u; const Anope::string &mname = params[0]; - Module *m = FindModule(mname); + Module *m = ModuleManager::FindModule(mname); if (!m) { source.Reply(_("Module \002%s\002 isn't loaded."), mname.c_str()); return MOD_CONT; } - if (!m->handle) - { - source.Reply(_("Unable to remove module \002%s\002"), m->name.c_str()); - return MOD_CONT; - } - - if (m->GetPermanent()) + if (!m->handle || m->GetPermanent()) { source.Reply(_("Unable to remove module \002%s\002"), m->name.c_str()); return MOD_CONT; @@ -65,7 +59,7 @@ class CommandOSModReLoad : public Command /* If a user is loading this module, then the core databases have already been loaded * so trigger the event manually */ - m = FindModule(mname); + m = ModuleManager::FindModule(mname); if (m) m->OnPostLoadDatabases(); } @@ -99,10 +93,9 @@ class OSModReLoad : public Module CommandOSModReLoad commandosmodreload; public: - OSModReLoad(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) + OSModReLoad(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE) { this->SetAuthor("Anope"); - this->SetType(CORE); this->SetPermanent(true); if (!operserv) |