aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-10 00:00:22 +0100
committerKim Alvefur <zash@zash.se>2016-01-10 00:00:22 +0100
commit2dd6c3b86122921a0655eceeb77e31ba81a8a5d5 (patch)
treee424e17a5bcd618ae7e33422a112497ca8b481b8 /plugins/mod_admin_telnet.lua
parente0cfa023d9435a295bc26f04ed529a523da38ae4 (diff)
downloadprosody-2dd6c3b86122921a0655eceeb77e31ba81a8a5d5.tar.gz
prosody-2dd6c3b86122921a0655eceeb77e31ba81a8a5d5.zip
mod_admin_telnet: c2s:count in less lines
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r--plugins/mod_admin_telnet.lua8
1 files changed, 1 insertions, 7 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index b45db3ef..73698ada 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -568,13 +568,7 @@ local function show_c2s(callback)
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";
+ return true, "Total: ".. iterators.count(values(module:shared"/*/c2s/sessions")) .." clients";
end
function def_env.c2s:show(match_jid, annotate)