aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-21 22:53:22 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-21 22:53:22 +0100
commit6202ef36ecb18cfcf2aee207ccbccec24899513e (patch)
treea0e8f1ac2424fa263da711a4214079e748bf245f /core/modulemanager.lua
parent2d053569057683dbba3f960522d760cee3a1aae3 (diff)
downloadprosody-6202ef36ecb18cfcf2aee207ccbccec24899513e.tar.gz
prosody-6202ef36ecb18cfcf2aee207ccbccec24899513e.zip
modulemanager: For children of shared modules, set module.environment to the empty environment for that module (useful to expose data or APIs at host.modules[module])
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index f263816b..aca314c0 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -144,6 +144,7 @@ local function do_load_module(host, module_name)
local ok, result, module_err = call_module_method(mod, "add_host", host_module_api);
if not ok or result == false then return nil, ok and module_err or result; end
local host_module = setmetatable({ module = host_module_api }, { __index = mod });
+ host_module.module.environment = host_module;
modulemap[host][module_name] = host_module;
return host_module;
end