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
commit0c6799c9368f41c38f2effceb29423e62b1693d2 (patch)
treeea25ff7f0ffdb4ed4b7d94f2de3908849a360f47 /core
parent1c88e91a1990b795c0d358f5b6d38c3d28288ea5 (diff)
downloadprosody-0c6799c9368f41c38f2effceb29423e62b1693d2.tar.gz
prosody-0c6799c9368f41c38f2effceb29423e62b1693d2.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