# HG changeset patch # User Kim Alvefur # Date 1330034699 -3600 # Node ID 429a007f70e80c7f9e49435d59b516fa40d30944 # Parent edd775310112da8fa9ae33577b650ed9c86ab760 mod_s2s: Attach send function to session diff -r edd775310112 -r 429a007f70e8 plugins/s2s/mod_s2s.lua --- a/plugins/s2s/mod_s2s.lua Thu Feb 23 23:03:28 2012 +0100 +++ b/plugins/s2s/mod_s2s.lua Thu Feb 23 23:04:59 2012 +0100 @@ -192,6 +192,9 @@ if session.secure and not session.cert_chain_status then check_cert_status(session); end + function session.send(data) + return send_to_host(session.to_host, session.from_host, data); + end send(""); send(st.stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.to_host, to=session.from_host, version=(session.version > 0 and "1.0" or nil) }):top_tag());