Comparison

plugins/mod_admin_telnet.lua @ 4644:fb067c8a8d2e

mod_admin_telnet: get_host_set(): Include '*' in the set if no specific hosts are specified and the module is loaded there
author Matthew Wild <mwild1@gmail.com>
date Sat, 21 Apr 2012 20:38:27 +0100
parent 4623:403b56b78018
child 4645:4539e99be743
comparison
equal deleted inserted replaced
4643:9008fc396fb1 4644:fb067c8a8d2e
275 end 275 end
276 elseif type(hosts) == "string" then 276 elseif type(hosts) == "string" then
277 return set.new { hosts }; 277 return set.new { hosts };
278 elseif hosts == nil then 278 elseif hosts == nil then
279 local mm = require "modulemanager"; 279 local mm = require "modulemanager";
280 return set.new(array.collect(keys(prosody.hosts))) 280 local hosts_set = set.new(array.collect(keys(prosody.hosts)))
281 / function (host) return prosody.hosts[host].type == "local" or module and mm.is_loaded(host, module); end; 281 / function (host) return prosody.hosts[host].type == "local" or module and mm.is_loaded(host, module); end;
282 if module and mm.get_module("*", module) then
283 hosts_set:add("*");
284 end
285 return hosts_set;
282 end 286 end
283 end 287 end
284 288
285 function def_env.module:load(name, hosts, config) 289 function def_env.module:load(name, hosts, config)
286 local mm = require "modulemanager"; 290 local mm = require "modulemanager";