projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e6bd7c
)
mod_admin_telnet: c2s:count in less lines
author
Kim Alvefur
<zash@zash.se>
Sat, 9 Jan 2016 23:00:22 +0000
(
00:00
+0100)
committer
Kim Alvefur
<zash@zash.se>
Sat, 9 Jan 2016 23:00:22 +0000
(
00:00
+0100)
plugins/mod_admin_telnet.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_admin_telnet.lua
b/plugins/mod_admin_telnet.lua
index b45db3efaa2d69d682ed197bc4129db8e228d7c7..73698adae58745783d1f22f808cede071c50281e 100644
(file)
--- 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)