diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-10-18 12:26:53 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-10-18 12:26:53 +0100 |
commit | 531956142c8f024a7da72207f912561d0295a8fc (patch) | |
tree | 8f5905cb1049dd67d0764121af12911e9fa6c1d8 /plugins/mod_console.lua | |
parent | 30b30a2c066aa4b908daeced38cc7b305f8bcde3 (diff) | |
download | prosody-531956142c8f024a7da72207f912561d0295a8fc.tar.gz prosody-531956142c8f024a7da72207f912561d0295a8fc.zip |
mod_console: Add missing hosts:list() command
Diffstat (limited to 'plugins/mod_console.lua')
-rw-r--r-- | plugins/mod_console.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index 552819c1..760bf596 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -600,6 +600,16 @@ function def_env.host:deactivate(hostname, reason) return true, "Host "..tostring(hostname).." deactivated"; end +function def_env.host:list() + local print = self.session.print; + local i = 0; + for host in values(array.collect(keys(prosody.hosts)):sort()) do + i = i + 1; + print(host); + end + return true, i.." hosts"; +end + ------------- function printbanner(session) |