Thu, 09 Jul 2009 14:41:56 +0100
mod_console: Expose commands and environment table
plugins/mod_console.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/mod_console.lua Thu Jul 09 14:37:04 2009 +0100 +++ b/plugins/mod_console.lua Thu Jul 09 14:41:56 2009 +0100 @@ -24,6 +24,8 @@ local def_env = {}; local default_env_mt = { __index = def_env }; +prosody.console = { commands = commands, env = def_env }; + local function redirect_output(_G, session) return setmetatable({ print = session.print }, { __index = function (t, k) return rawget(_G, k); end, __newindex = function (t, k, v) rawset(_G, k, v); end }); end