diff options
author | Kim Alvefur <zash@zash.se> | 2020-02-22 18:32:50 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-02-22 18:32:50 +0100 |
commit | 5fe826e31796743c7ca1042a2f5301880189d3e1 (patch) | |
tree | 0b7cd3c609a965d6272be78d4fbbf50e9dd2adc3 /plugins/mod_admin_telnet.lua | |
parent | 62e66fe940cd820119b90ad40fba347894ff7d52 (diff) | |
download | prosody-5fe826e31796743c7ca1042a2f5301880189d3e1.tar.gz prosody-5fe826e31796743c7ca1042a2f5301880189d3e1.zip |
mod_admin_telnet: Fix host selection filter, fixes loading on components
get_hosts_with_module(a component, mod) would still filter out
components since they don't have type="component" instead of "local"
Introduced in 4d3549e64489
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 730053fe..2688209b 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -385,10 +385,24 @@ end local function get_hosts_with_module(hosts, module) local hosts_set = get_hosts_set(hosts) / function (host) - if prosody.hosts[host].type == "local" or module and modulemanager.is_loaded(host, module) then - return host; + if module then + -- Module given, filter in hosts with this module loaded + if modulemanager.is_loaded(host, module) then + return host; + else + return nil; + end + end + if not hosts then + -- No hosts given, filter in VirtualHosts + if prosody.hosts[host].type == "local" then + return host; + else + return nil + end end; - return nil; + -- No module given, but hosts are, don't filter at all + return host; end; if module and modulemanager.get_module("*", module) then hosts_set:add("*"); |