aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-11-13 04:09:14 +0000
committerMatthew Wild <mwild1@gmail.com>2010-11-13 04:09:14 +0000
commit449a83920586649fa2d5d97fbf0989ef546fd133 (patch)
tree56a5ad80359766c2f9367ea1f64731932217d684
parent3ffba43bf566c8655196df75f5ce1cc127e30af8 (diff)
downloadprosody-449a83920586649fa2d5d97fbf0989ef546fd133.tar.gz
prosody-449a83920586649fa2d5d97fbf0989ef546fd133.zip
modulemanager: Inside plugins, have global _M as a reference to the module's environment
-rw-r--r--core/modulemanager.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 49ad12ac..c78c315b 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -117,6 +117,7 @@ function load(host, module_name, config)
local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
api_instance.environment = pluginenv;
+ pluginenv._M = pluginenv;
setfenv(mod, pluginenv);
hosts[host].modules = modulemap[host];