aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-05-11 19:03:23 +0200
committerKim Alvefur <zash@zash.se>2014-05-11 19:03:23 +0200
commit3224f0cee2dccb23550debe2c59333bef25921c2 (patch)
treeb212217277ba0d7676d14d202ccaf46a261cfcef /plugins
parent7e94c08bb2b03b4946cebcb1625d3b4be6de5514 (diff)
downloadprosody-3224f0cee2dccb23550debe2c59333bef25921c2.tar.gz
prosody-3224f0cee2dccb23550debe2c59333bef25921c2.zip
mod_admin_telnet: Move extraction of c2s presence info into session_flags()
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_telnet.lua13
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";