# HG changeset patch # User Kim Alvefur # Date 1335626283 -7200 # Node ID 9f2639b3d9b114efa0688d5e580706fbd6ba6707 # Parent dbe9d75c04528a1cb5c721088a5bb496fd80399e mod_admin_telnet: Add c2s:count() which shows number of connected users. diff -r dbe9d75c0452 -r 9f2639b3d9b1 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Sat Apr 28 15:47:43 2012 +0100 +++ b/plugins/mod_admin_telnet.lua Sat Apr 28 17:18:03 2012 +0200 @@ -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;