aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-01-22 19:27:06 +0000
committerMatthew Wild <mwild1@gmail.com>2012-01-22 19:27:06 +0000
commit11bf5edc1d5395822ab2dfe1edc84af85bc6dc57 (patch)
treeb01332fb73679a9c7330be93cc6a5b1d25159931
parentb7625791b1405721a4a9d9d7392328a6a372c2ef (diff)
downloadprosody-11bf5edc1d5395822ab2dfe1edc84af85bc6dc57.tar.gz
prosody-11bf5edc1d5395822ab2dfe1edc84af85bc6dc57.zip
modulemanager: load(): Return and use the correct module object
-rw-r--r--core/modulemanager.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index a6d1ad35..a192e637 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -170,7 +170,7 @@ local function do_load_module(host, module_name)
log("error", "Error initializing module '%s' on '%s': %s", module_name, host, err or "nil");
do_unload_module(api_instance.host, module_name); -- Ignore error, module may be partially-loaded
end
- return ok and mod, err;
+ return ok and pluginenv, err;
end
local function do_reload_module(host, name)
@@ -219,7 +219,7 @@ end
function load(host, name)
local mod, err = do_load_module(host, name);
if mod then
- (hosts[mod.host] or prosody).events.fire_event("module-loaded", { module = module_name, host = host });
+ (hosts[mod.module.host] or prosody).events.fire_event("module-loaded", { module = name, host = host });
end
return mod, err;
end