diff options
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; } |