aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-12-01 19:57:33 +0000
committerMatthew Wild <mwild1@gmail.com>2009-12-01 19:57:33 +0000
commit29d4a0246b3fcf2a6c75cf42b41c11ec658dab32 (patch)
tree2c2a24033feac36afc5c4cad6bc3375bc7c589c4 /core/modulemanager.lua
parent2100104326791787aafc14012c731e54ed4c35fa (diff)
downloadprosody-29d4a0246b3fcf2a6c75cf42b41c11ec658dab32.tar.gz
prosody-29d4a0246b3fcf2a6c75cf42b41c11ec658dab32.zip
modulemanager: Fire events module-loaded and module-unloaded, both receive a table with 'module' and 'host' fields, thanks bjc
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index d1f7d413..6440f8b8 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -158,6 +158,7 @@ function load(host, module_name, config)
log("error", "Error initializing module '%s' on '%s': %s", module_name, host, err or "nil");
end
if success then
+ hosts[host].events.fire_event("module-loaded", { module = module_name, host = host });
return true;
else -- load failed, unloading
unload(api_instance.host, module_name);
@@ -200,6 +201,7 @@ function unload(host, name, ...)
end
hooks:remove(host, name);
modulemap[host][name] = nil;
+ hosts[host].events.fire_event("module-unloaded", { module = name, host = host });
return true;
end