Software /
code /
prosody
Diff
core/modulemanager.lua @ 2584:5091548a3805
modulemanager: Make the plugin environment available directly (module.environment within plugins).
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 11 Feb 2010 05:34:53 +0500 |
parent | 2479:9c074ba1f662 |
child | 2585:a9e99897b2e8 |
line wrap: on
line diff
--- a/core/modulemanager.lua Thu Feb 11 05:21:03 2010 +0500 +++ b/core/modulemanager.lua Thu Feb 11 05:34:53 2010 +0500 @@ -127,6 +127,7 @@ local api_instance = setmetatable({ name = module_name, host = host, config = config, _log = _log, log = function (self, ...) return _log(...); end }, { __index = api }); local pluginenv = setmetatable({ module = api_instance }, { __index = _G }); + api_instance.environment = pluginenv; setfenv(mod, pluginenv); if not hosts[host] then