aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-06-22 02:58:05 +0100
committerMatthew Wild <mwild1@gmail.com>2009-06-22 02:58:05 +0100
commite418f8a9c642c2b0c1ab06160441de068350ac72 (patch)
tree14a8850f5b2d4ffeef6ef5b63f1fca597bb38092 /core/modulemanager.lua
parent0f51eb5fa1f49a1a094e291528bf954c63dfadfd (diff)
downloadprosody-e418f8a9c642c2b0c1ab06160441de068350ac72.tar.gz
prosody-e418f8a9c642c2b0c1ab06160441de068350ac72.zip
modulemanager: Call 'load' method when loading a module
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index d6220cec..c7aa5cce 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -134,6 +134,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;