aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-07-26 21:05:13 +0200
committerKim Alvefur <zash@zash.se>2019-07-26 21:05:13 +0200
commit65b25e80b00cd99a78a3d8ee9b5a916795e53774 (patch)
tree9f56eb7ed5cfe7c9614c7df4123680b8a79ba633
parent3effd36ff0bb97de406768b838cf51c9d7c0af41 (diff)
downloadprosody-65b25e80b00cd99a78a3d8ee9b5a916795e53774.tar.gz
prosody-65b25e80b00cd99a78a3d8ee9b5a916795e53774.zip
mod_admin_telnet: Factor out function for collecting all c2s sessions for easier reuse
-rw-r--r--plugins/mod_admin_telnet.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index af0ac9e7..4e34455c 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -592,12 +592,16 @@ local function get_jid(session)
return jid_join("["..ip.."]:"..clientport, session.host or "["..serverip.."]:"..serverport);
end
-local function show_c2s(callback)
+local function get_c2s()
local c2s = array.collect(values(prosody.full_sessions));
c2s:append(array.collect(values(module:shared"/*/c2s/sessions")));
c2s:append(array.collect(values(module:shared"/*/bosh/sessions")));
c2s:unique();
- c2s:sort(function(a, b)
+ return c2s;
+end
+
+local function show_c2s(callback)
+ get_c2s():sort(function(a, b)
if a.host == b.host then
if a.username == b.username then
return (a.resource or "") > (b.resource or "");