Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 10085:bf51a08a94a7
mod_admin_telnet: Make c2s:count() consistent with c2s:show()
Both now operate on the same complete set of c2s sessions
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 26 Jul 2019 21:06:47 +0200 |
parent | 10084:e4043e3928f2 |
child | 10086:4ade3674baf0 |
comparison
equal
deleted
inserted
replaced
10084:e4043e3928f2 | 10085:bf51a08a94a7 |
---|---|
613 callback(get_jid(session), session) | 613 callback(get_jid(session), session) |
614 end); | 614 end); |
615 end | 615 end |
616 | 616 |
617 function def_env.c2s:count() | 617 function def_env.c2s:count() |
618 local c2s_count = iterators.count(values(module:shared"/*/c2s/sessions")) | 618 local c2s = get_c2s(); |
619 local bosh_count = iterators.count(values(module:shared"/*/bosh/sessions")) | 619 return true, "Total: ".. #c2s .." clients"; |
620 return true, "Total: ".. c2s_count + bosh_count .." clients"; | |
621 end | 620 end |
622 | 621 |
623 function def_env.c2s:show(match_jid, annotate) | 622 function def_env.c2s:show(match_jid, annotate) |
624 local print, count = self.session.print, 0; | 623 local print, count = self.session.print, 0; |
625 annotate = annotate or session_flags; | 624 annotate = annotate or session_flags; |