aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-15 22:08:20 +0100
committerKim Alvefur <zash@zash.se>2019-12-15 22:08:20 +0100
commit9eea55bee824ffe812459eb7a3cf7ab26462f3dd (patch)
treeaa4e46d028e4c2f3320627a76df81a85f6add4a2 /plugins/mod_admin_telnet.lua
parent5f7845641e8664aa63f31b1eb38049e8f6f396cb (diff)
downloadprosody-9eea55bee824ffe812459eb7a3cf7ab26462f3dd.tar.gz
prosody-9eea55bee824ffe812459eb7a3cf7ab26462f3dd.zip
mod_admin_telnet: Sort hosts in module:list
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r--plugins/mod_admin_telnet.lua11
1 files changed, 1 insertions, 10 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index fffab4cf..fbaa80d0 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -466,16 +466,7 @@ function def_env.module:reload(name, hosts)
end
function def_env.module:list(hosts)
- if hosts == nil then
- hosts = array.collect(keys(prosody.hosts));
- table.insert(hosts, 1, "*");
- end
- if type(hosts) == "string" then
- hosts = { hosts };
- end
- if type(hosts) ~= "table" then
- return false, "Please supply a host or a list of hosts you would like to see";
- end
+ hosts = array.collect(set.new({ not hosts and "*" or nil }) + get_hosts_set(hosts)):sort(_sort_hosts);
local print = self.session.print;
for _, host in ipairs(hosts) do