# HG changeset patch # User Kim Alvefur # Date 1371651633 -7200 # Node ID 896094da72e490aa7662b66c0f2b3fd15eca7a6b # Parent 6eebd5808fbc1f2ac3dd95fc0f1a43020e5aaf66 mod_admin_telnet: Refactor s2s:showcert() diff -r 6eebd5808fbc -r 896094da72e4 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Tue Jun 18 23:02:20 2013 +0200 +++ b/plugins/mod_admin_telnet.lua Wed Jun 19 16:20:33 2013 +0200 @@ -683,14 +683,9 @@ 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;