aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-05-12 01:07:40 +0200
committerKim Alvefur <zash@zash.se>2014-05-12 01:07:40 +0200
commit9ad11cba377175f3120b56201740890fc80e4066 (patch)
tree24ef809069212fdde736b02fc61c627f0335faab /plugins/mod_admin_telnet.lua
parentc5395883d6fd6a2e70c1aed5ce68218fe84f7e10 (diff)
downloadprosody-9ad11cba377175f3120b56201740890fc80e4066.tar.gz
prosody-9ad11cba377175f3120b56201740890fc80e4066.zip
mod_admin_telnet: Show which hosts are components and what type of component in host:list()
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r--plugins/mod_admin_telnet.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index a3352b10..6a8783e2 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -872,9 +872,19 @@ end
function def_env.host:list()
local print = self.session.print;
local i = 0;
+ local type;
for host in values(array.collect(keys(prosody.hosts)):sort()) do
i = i + 1;
- print(host);
+ type = hosts[host].type;
+ if type == "local" then
+ print(host);
+ else
+ type = module:context(host):get_option_string("component_module", type);
+ if type ~= "component" then
+ type = type .. " component";
+ end
+ print(("%s (%s)"):format(host, type));
+ end
end
return true, i.." hosts";
end