aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-05-17 14:56:06 +0200
committerKim Alvefur <zash@zash.se>2013-05-17 14:56:06 +0200
commit3e84bba552f7671c40ba3e187110407fded8ccf0 (patch)
treed46840d1c94ec77f15d629c01b769d0ea555ed62 /plugins
parentf1c9248f6b9ec0bc80c19e8eaa437ea066d3a8f8 (diff)
downloadprosody-3e84bba552f7671c40ba3e187110407fded8ccf0.tar.gz
prosody-3e84bba552f7671c40ba3e187110407fded8ccf0.zip
mod_admin_telnet: List session flags (encryption, compression etc) the same way for c2s as s2s
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_telnet.lua38
1 files changed, 20 insertions, 18 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index b67ba576..08fe57c0 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -484,6 +484,25 @@ end
function def_env.hosts:add(name)
end
+local function session_flags(session, line)
+ line = line or {};
+ if session.cert_identity_status == "valid" then
+ line[#line+1] = "(secure)";
+ elseif session.secure then
+ line[#line+1] = "(encrypted)";
+ end
+ if session.compressed then
+ line[#line+1] = "(compressed)";
+ end
+ if session.smacks then
+ line[#line+1] = "(sm)";
+ end
+ if (session.ip or session.conn and session.conn:ip()):match(":") then
+ line[#line+1] = "(IPv6)";
+ end
+ return table.concat(line, " ");
+end
+
def_env.c2s = {};
local function show_c2s(callback)
@@ -526,7 +545,7 @@ function def_env.c2s:show(match_jid)
status = "available";
end
end
- print(" "..jid.." - "..status.."("..priority..")");
+ print(session_flags(session, { " "..jid.." - "..status.."("..priority..")" }));
end
end);
return true, "Total: "..count.." clients";
@@ -565,23 +584,6 @@ function def_env.c2s:close(match_jid)
return true, "Total: "..count.." sessions closed";
end
-local function session_flags(session, line)
- if session.cert_identity_status == "valid" then
- line[#line+1] = "(secure)";
- elseif session.secure then
- line[#line+1] = "(encrypted)";
- end
- if session.compressed then
- line[#line+1] = "(compressed)";
- end
- if session.smacks then
- line[#line+1] = "(sm)";
- end
- if session.conn and session.conn:ip():match(":") then
- line[#line+1] = "(IPv6)";
- end
- return table.concat(line, " ");
-end
def_env.s2s = {};
function def_env.s2s:show(match_jid)