mod_admin_telnet: Make c2s:count() consistent with c2s:show()
authorKim Alvefur <zash@zash.se>
Fri, 26 Jul 2019 21:06:47 +0200
changeset 10089 bf51a08a94a7
parent 10088 e4043e3928f2
child 10090 4ade3674baf0
mod_admin_telnet: Make c2s:count() consistent with c2s:show() Both now operate on the same complete set of c2s sessions
plugins/mod_admin_telnet.lua
--- a/plugins/mod_admin_telnet.lua	Fri Jul 26 21:05:13 2019 +0200
+++ b/plugins/mod_admin_telnet.lua	Fri Jul 26 21:06:47 2019 +0200
@@ -615,9 +615,8 @@
 end
 
 function def_env.c2s:count()
-	local c2s_count = iterators.count(values(module:shared"/*/c2s/sessions"))
-	local bosh_count = iterators.count(values(module:shared"/*/bosh/sessions"))
-	return true, "Total: "..  c2s_count + bosh_count .." clients";
+	local c2s = get_c2s();
+	return true, "Total: "..  #c2s .." clients";
 end
 
 function def_env.c2s:show(match_jid, annotate)