Software /
code /
prosody
Changeset
4643:9008fc396fb1
modulemanager: When a shared module becomes global, ensure it still gets loaded onto the original target host
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 21 Apr 2012 20:37:06 +0100 |
parents | 4642:c1602c07d14d |
children | 4644:fb067c8a8d2e |
files | core/modulemanager.lua |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/core/modulemanager.lua Sat Apr 21 20:09:03 2012 +0100 +++ b/core/modulemanager.lua Sat Apr 21 20:37:06 2012 +0100 @@ -183,8 +183,10 @@ 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