Software /
code /
prosody
Diff
plugins/mod_console.lua @ 1506:2c8aa16b4f64
mod_console: Expose commands and environment table
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 09 Jul 2009 14:41:56 +0100 |
parent | 1503:5970e06d9335 |
child | 1523:841d61be198f |
line wrap: on
line diff
--- 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