mod_console: c2s:show(): Group listed clients by host

Wed, 09 Sep 2009 14:35:41 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 09 Sep 2009 14:35:41 +0100
changeset 1763
9e4ff3b66ed1
parent 1762
f522a0f195f9
child 1764
c00d4ba8d2f3

mod_console: c2s:show(): Group listed clients by host

plugins/mod_console.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_console.lua	Tue Sep 08 14:38:51 2009 +0100
+++ b/plugins/mod_console.lua	Wed Sep 09 14:35:41 2009 +0100
@@ -373,7 +373,12 @@
 
 function def_env.c2s:show(match_jid)
 	local print, count = self.session.print, 0;
+	local curr_host;
 	show_c2s(function (jid, session)
+		if curr_host ~= session.host then
+			curr_host = session.host;
+			print(curr_host);
+		end
 		if (not match_jid) or jid:match(match_jid) then
 			count = count + 1;
 			local status, priority = "unavailable", tostring(session.priority or "-");
@@ -385,7 +390,7 @@
 					status = "available";
 				end
 			end
-			print(jid.." - "..status.."("..priority..")");
+			print("   "..jid.." - "..status.."("..priority..")");
 		end		
 	end);
 	return true, "Total: "..count.." clients";

mercurial