Software /
code /
prosody
Comparison
plugins/s2s/mod_s2s.lua @ 4561:429a007f70e8
mod_s2s: Attach send function to session
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 23 Feb 2012 23:04:59 +0100 |
parent | 4560:edd775310112 |
child | 4573:09255a10fdfa |
comparison
equal
deleted
inserted
replaced
4560:edd775310112 | 4561:429a007f70e8 |
---|---|
190 end | 190 end |
191 end | 191 end |
192 | 192 |
193 if session.secure and not session.cert_chain_status then check_cert_status(session); end | 193 if session.secure and not session.cert_chain_status then check_cert_status(session); end |
194 | 194 |
195 function session.send(data) | |
196 return send_to_host(session.to_host, session.from_host, data); | |
197 end | |
195 send("<?xml version='1.0'?>"); | 198 send("<?xml version='1.0'?>"); |
196 send(st.stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', | 199 send(st.stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', |
197 ["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()); | 200 ["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()); |
198 if session.version >= 1.0 then | 201 if session.version >= 1.0 then |
199 local features = st.stanza("stream:features"); | 202 local features = st.stanza("stream:features"); |