Diff

plugins/mod_admin_telnet.lua @ 4646:e0bd8587f2fb

mod_admin_telnet: module:list(): List global modules (part-fixes #228)
author Matthew Wild <mwild1@gmail.com>
date Sat, 21 Apr 2012 20:39:52 +0100
parent 4645:4539e99be743
child 4647:57a4f863e48f
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Sat Apr 21 20:39:21 2012 +0100
+++ b/plugins/mod_admin_telnet.lua	Sat Apr 21 20:39:52 2012 +0100
@@ -363,6 +363,7 @@
 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 };
@@ -373,8 +374,8 @@
 	
 	local print = self.session.print;
 	for _, host in ipairs(hosts) do
-		print(host..":");
-		local modules = array.collect(keys(prosody.hosts[host] and prosody.hosts[host].modules or {})):sort();
+		print((host == "*" and "Global" or host)..":");
+		local modules = array.collect(keys(modulemanager.get_modules(host) or {})):sort();
 		if #modules == 0 then
 			if prosody.hosts[host] then
 				print("    No modules loaded");