Thu, 18 Feb 2010 16:22:50 +0000
modulemanager: Fix traceback on unloading global modules (thanks KSid)
core/modulemanager.lua | file | annotate | diff | comparison | revisions |
--- a/core/modulemanager.lua Wed Feb 17 13:21:33 2010 +0000 +++ b/core/modulemanager.lua Thu Feb 18 16:22:50 2010 +0000 @@ -158,7 +158,7 @@ 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 @@ 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