aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-18 12:26:53 +0100
committerMatthew Wild <mwild1@gmail.com>2009-10-18 12:26:53 +0100
commit531956142c8f024a7da72207f912561d0295a8fc (patch)
tree8f5905cb1049dd67d0764121af12911e9fa6c1d8
parent30b30a2c066aa4b908daeced38cc7b305f8bcde3 (diff)
downloadprosody-531956142c8f024a7da72207f912561d0295a8fc.tar.gz
prosody-531956142c8f024a7da72207f912561d0295a8fc.zip
mod_console: Add missing hosts:list() command
-rw-r--r--plugins/mod_console.lua10
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)