plugins/mod_console.lua

changeset 2010
1a4f14ea39b6
parent 2009
3f9cce29c57d
child 2055
a43aea9b0bd1
equal deleted inserted replaced
2009:3f9cce29c57d 2010:1a4f14ea39b6
343 end 343 end
344 344
345 local print = self.session.print; 345 local print = self.session.print;
346 for _, host in ipairs(hosts) do 346 for _, host in ipairs(hosts) do
347 print(host..":"); 347 print(host..":");
348 local modules = array.collect(keys(prosody.hosts[host].modules or {})):sort(); 348 local modules = array.collect(keys(prosody.hosts[host] and prosody.hosts[host].modules or {})):sort();
349 if #modules == 0 then 349 if #modules == 0 then
350 print(" No modules loaded"); 350 if prosody.hosts[host] then
351 print(" No modules loaded");
352 else
353 print(" Host not found");
354 end
351 else 355 else
352 for _, name in ipairs(modules) do 356 for _, name in ipairs(modules) do
353 print(" "..name); 357 print(" "..name);
354 end 358 end
355 end 359 end

mercurial