diff options
author | Kim Alvefur <zash@zash.se> | 2014-05-11 19:03:23 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-05-11 19:03:23 +0200 |
commit | 0fb4279fe5d28e501b5dee6ecda12132f78d6ebc (patch) | |
tree | b212217277ba0d7676d14d202ccaf46a261cfcef /plugins | |
parent | 0ee4420961ce3899e326813e9a33ec0fdc78ade7 (diff) | |
download | prosody-0fb4279fe5d28e501b5dee6ecda12132f78d6ebc.tar.gz prosody-0fb4279fe5d28e501b5dee6ecda12132f78d6ebc.zip |
mod_admin_telnet: Move extraction of c2s presence info into session_flags()
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index bdd2caab..db7c3425 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -492,6 +492,13 @@ end local function session_flags(session, line) line = line or {}; + if session.type == "c2s" then + local status, priority = "unavailable", tostring(session.priority or "-"); + if session.presence then + status = session.presence:get_child_text("show") or "available"; + end + line[#line+1] = status.."("..priority..")"; + end if session.cert_identity_status == "valid" then line[#line+1] = "(authenticated)"; end @@ -543,11 +550,7 @@ function def_env.c2s:show(match_jid) end if (not match_jid) or jid:match(match_jid) then count = count + 1; - local status, priority = "unavailable", tostring(session.priority or "-"); - if session.presence then - status = session.presence:get_child_text("show") or "available"; - end - print(session_flags(session, { " "..jid.." - "..status.."("..priority..")" })); + print(session_flags(session, { " ", jid })); end end); return true, "Total: "..count.." clients"; |