aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-06-23 15:58:56 +0100
committerMatthew Wild <mwild1@gmail.com>2009-06-23 15:58:56 +0100
commitf00a5d70b30b132b763b2e20c68accb8ce52789d (patch)
tree0741204836fedee0caea15f4607bd996d7e5fdab /core/modulemanager.lua
parent3f141a44c2b4564e5d88748f76f53f5fec6c1a33 (diff)
parent54bbd9c98aa6e40463982ec2a92fa9a444704b43 (diff)
downloadprosody-f00a5d70b30b132b763b2e20c68accb8ce52789d.tar.gz
prosody-f00a5d70b30b132b763b2e20c68accb8ce52789d.zip
Automated merge with http://waqas.ath.cx:8000/
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index f160521f..082dcbb8 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -38,7 +38,8 @@ local _G = _G;
module "modulemanager"
-local api = {}; -- Module API container
+api = {};
+local api = api; -- Module API container
local modulemap = { ["*"] = {} };
@@ -134,6 +135,13 @@ function load(host, module_name, config)
return nil, ret;
end
+ if module_has_method(pluginenv, "load") then
+ local ok, err = call_module_method(pluginenv, "load");
+ if (not ok) and err then
+ log("warn", "Error loading module '%s' on '%s': %s", module_name, host, err);
+ end
+ end
+
-- Use modified host, if the module set one
modulemap[api_instance.host][module_name] = pluginenv;
@@ -190,7 +198,7 @@ function reload(host, name, ...)
local _mod, err = pluginloader.load_code(name); -- checking for syntax errors
if not _mod then
- log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
+ log("error", "Unable to load module '%s': %s", name or "nil", err or "nil");
return nil, err;
end