Comparison

plugins/mod_admin_telnet.lua @ 10657:197ba9539390

mod_admin_telnet: Reflow hosts filter for readability
author Kim Alvefur <zash@zash.se>
date Sat, 22 Feb 2020 18:23:38 +0100
parent 10644:6c4ab1b87588
child 10658:52c6dfa04dba
comparison
equal deleted inserted replaced
10656:ffa9a20aca8b 10657:197ba9539390
382 382
383 -- Hosts with a module or all virtualhosts if no module given 383 -- Hosts with a module or all virtualhosts if no module given
384 -- matching modules_enabled in the global section 384 -- matching modules_enabled in the global section
385 local function get_hosts_with_module(hosts, module) 385 local function get_hosts_with_module(hosts, module)
386 local hosts_set = get_hosts_set(hosts) 386 local hosts_set = get_hosts_set(hosts)
387 / function (host) return (prosody.hosts[host].type == "local" or module and modulemanager.is_loaded(host, module)) and host or nil; end; 387 / function (host)
388 if prosody.hosts[host].type == "local" or module and modulemanager.is_loaded(host, module) then
389 return host;
390 end;
391 return nil;
392 end;
388 if module and modulemanager.get_module("*", module) then 393 if module and modulemanager.get_module("*", module) then
389 hosts_set:add("*"); 394 hosts_set:add("*");
390 end 395 end
391 return hosts_set; 396 return hosts_set;
392 end 397 end