Software /
code /
prosody
Changeset
1506:2c8aa16b4f64
mod_console: Expose commands and environment table
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 09 Jul 2009 14:41:56 +0100 |
parents | 1505:e19cb945c25b |
children | 1507:92357dffe743 |
files | plugins/mod_console.lua |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
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