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 | 3122b6ee6e4e7e530967eeefe9f60300fdfaf7a9 (patch) | |
tree | a5d032a6ceff68f772e76b8329078084a33c4a64 /plugins/mod_admin_telnet.lua | |
parent | 15c9e030d7a54bb5a3c1acc77eb4dca3b1a9f28b (diff) | |
download | prosody-3122b6ee6e4e7e530967eeefe9f60300fdfaf7a9.tar.gz prosody-3122b6ee6e4e7e530967eeefe9f60300fdfaf7a9.zip |
mod_admin_telnet: Refactor s2s:showcert()
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-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; |