aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-02-18 16:22:50 +0000
committerMatthew Wild <mwild1@gmail.com>2010-02-18 16:22:50 +0000
commit9db76151d498844384b41a0f15443af996baf7e2 (patch)
treea288b733e8fb4a2931b09b911add8480f10039db /core
parentbdcaada3687a20fd3a7a7728b09d19e92893fba0 (diff)
downloadprosody-9db76151d498844384b41a0f15443af996baf7e2.tar.gz
prosody-9db76151d498844384b41a0f15443af996baf7e2.zip
modulemanager: Fix traceback on unloading global modules (thanks KSid)
Diffstat (limited to 'core')
-rw-r--r--core/modulemanager.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 6b2260f5..1174352b 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -158,7 +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 });
+ (hosts[api_instance.host] or prosody).events.fire_event("module-loaded", { module = module_name, host = host });
return true;
else -- load failed, unloading
unload(api_instance.host, module_name);
@@ -210,7 +210,7 @@ function unload(host, name, ...)
end
end
modulemap[host][name] = nil;
- hosts[host].events.fire_event("module-unloaded", { module = name, host = host });
+ (hosts[host] or prosody).events.fire_event("module-unloaded", { module = name, host = host });
return true;
end