diff options
author | Kim Alvefur <zash@zash.se> | 2013-06-19 16:20:33 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-06-19 16:20:33 +0200 |
commit | 54a6165d5d48aa248151811dbff7c09cafe8be12 (patch) | |
tree | a5d032a6ceff68f772e76b8329078084a33c4a64 | |
parent | 9d0a1129b79bd5546d2583d38dca1ef1605ab4d4 (diff) | |
download | prosody-54a6165d5d48aa248151811dbff7c09cafe8be12.tar.gz prosody-54a6165d5d48aa248151811dbff7c09cafe8be12.zip |
mod_admin_telnet: Refactor s2s:showcert()
-rw-r--r-- | plugins/mod_admin_telnet.lua | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 73c4a578..85a9bd5c 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -683,14 +683,9 @@ end function def_env.s2s:showcert(domain) local ser = require "util.serialization".serialize; local print = self.session.print; - local domain_sessions = set.new(array.collect(keys(incoming_s2s))) - /function(session) return session.from_host == domain and session or nil; end; - for local_host in values(prosody.hosts) do - local s2sout = local_host.s2sout; - if s2sout and s2sout[domain] then - domain_sessions:add(s2sout[domain]); - end - end + local s2s_sessions = module:shared"/*/s2s/sessions"; + local domain_sessions = set.new(array.collect(values(s2s_sessions))) + /function(session) return (session.to_host == domain or session.from_host == domain) and session or nil; end; local cert_set = {}; for session in domain_sessions do local conn = session.conn; |