aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-21 20:37:06 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-21 20:37:06 +0100
commit1894252bd4d000923088e4db37de91c0270b323a (patch)
treeea25ff7f0ffdb4ed4b7d94f2de3908849a360f47 /core
parentf51d5c0bd00c83ed10eae136e95dc49a0d61b684 (diff)
downloadprosody-1894252bd4d000923088e4db37de91c0270b323a.tar.gz
prosody-1894252bd4d000923088e4db37de91c0270b323a.zip
modulemanager: When a shared module becomes global, ensure it still gets loaded onto the original target host
Diffstat (limited to 'core')
-rw-r--r--core/modulemanager.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index e76f2624..f263816b 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -183,8 +183,10 @@ local function do_load_module(host, module_name)
log("warn", "mod_%s: Setting module.host = '*' deprecated, call module:set_global() instead", module_name);
api_instance:set_global();
end
- else
- modulemap[host][module_name] = pluginenv;
+ if host ~= api_instance.host and module_has_method(pluginenv, "add_host") then
+ -- Now load the module again onto the host it was originally being loaded on
+ do_load_module(host, module_name);
+ end
end
end
if not ok then