Changeset

4781:51ed468662a1

Merge with Zash
author Matthew Wild <mwild1@gmail.com>
date Sat, 28 Apr 2012 16:22:17 +0100
parents 4780:4b8f2b91826c (current diff) 4779:9f2639b3d9b1 (diff)
children 4782:28e7664924bd
files
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Sat Apr 28 16:21:57 2012 +0100
+++ b/plugins/mod_admin_telnet.lua	Sat Apr 28 16:22:17 2012 +0100
@@ -440,6 +440,16 @@
 	end
 end
 
+function def_env.c2s:count(match_jid)
+	local count = 0;
+	show_c2s(function (jid, session)
+		if (not match_jid) or jid:match(match_jid) then
+			count = count + 1;
+		end		
+	end);
+	return true, "Total: "..count.." clients";
+end
+
 function def_env.c2s:show(match_jid)
 	local print, count = self.session.print, 0;
 	local curr_host;