diff options
author | Adam <Adam@anope.org> | 2010-10-02 21:09:11 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-10-02 21:09:11 -0400 |
commit | 90f0a7c92ac34bc70c0905c20aaf3f7e8a85f289 (patch) | |
tree | a2bf75cc912ed3803157d10761dbea2c2475ffb1 /modules/core/os_modload.cpp | |
parent | 0d684191e99a689c80560018dd52e6d8fd5dc549 (diff) |
Added os_modreload. Also allow unloading database and encryption modules since there isn't a reason we cant allow reloading them. Soon os_modreload will allow reloading the protocol modules.
Diffstat (limited to 'modules/core/os_modload.cpp')
-rw-r--r-- | modules/core/os_modload.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/core/os_modload.cpp b/modules/core/os_modload.cpp index b35cf0730..385353993 100644 --- a/modules/core/os_modload.cpp +++ b/modules/core/os_modload.cpp @@ -31,11 +31,21 @@ class CommandOSModLoad : public Command return MOD_CONT; } - int status = ModuleManager::LoadModule(mname, u); - if (status != MOD_ERR_OK) + ModuleReturn status = ModuleManager::LoadModule(mname, u); + if (status == MOD_ERR_OK) { - u->SendMessage(OperServ, OPER_MODULE_LOAD_FAIL, mname.c_str()); + ircdproto->SendGlobops(OperServ, "%s loaded module %s", u->nick.c_str(), mname.c_str()); + u->SendMessage(OperServ, OPER_MODULE_LOADED, mname.c_str()); + + /* If a user is loading this module, then the core databases have already been loaded + * so trigger the event manually + */ + m = FindModule(mname); + if (m) + m->OnPostLoadDatabases(); } + else + u->SendMessage(OperServ, OPER_MODULE_LOAD_FAIL, mname.c_str()); return MOD_CONT; } |