Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 10083:f30d505e755b
mod_admin_telnet: Include both c2s connections and sessions in c2s:show()
This way both incomplete connections and hibernating c2s sessions are shown.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 26 Jul 2019 20:25:15 +0200 |
parent | 10068:73a8192058f9 |
child | 10084:e4043e3928f2 |
comparison
equal
deleted
inserted
replaced
10082:1df53ef1f60d | 10083:f30d505e755b |
---|---|
591 local serverport = conn and conn:serverport() or "?" | 591 local serverport = conn and conn:serverport() or "?" |
592 return jid_join("["..ip.."]:"..clientport, session.host or "["..serverip.."]:"..serverport); | 592 return jid_join("["..ip.."]:"..clientport, session.host or "["..serverip.."]:"..serverport); |
593 end | 593 end |
594 | 594 |
595 local function show_c2s(callback) | 595 local function show_c2s(callback) |
596 local c2s = array.collect(values(module:shared"/*/c2s/sessions")); | 596 local c2s = array.collect(values(prosody.full_sessions)); |
597 c2s:append(array.collect(values(module:shared"/*/c2s/sessions"))); | |
597 c2s:append(array.collect(values(module:shared"/*/bosh/sessions"))); | 598 c2s:append(array.collect(values(module:shared"/*/bosh/sessions"))); |
599 c2s:unique(); | |
598 c2s:sort(function(a, b) | 600 c2s:sort(function(a, b) |
599 if a.host == b.host then | 601 if a.host == b.host then |
600 if a.username == b.username then | 602 if a.username == b.username then |
601 return (a.resource or "") > (b.resource or ""); | 603 return (a.resource or "") > (b.resource or ""); |
602 end | 604 end |