From 531956142c8f024a7da72207f912561d0295a8fc Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 18 Oct 2009 12:26:53 +0100 Subject: mod_console: Add missing hosts:list() command --- plugins/mod_console.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins') 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) -- cgit v1.2.3