Software /
code /
prosody
Changeset
4584:9a5de6509aa8
mod_s2s, mod_dialback: Event on pre-XMPP streams, so we can try dialback.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 03 Mar 2012 01:35:39 +0100 (2012-03-03) |
parents | 4583:6f2789939d35 |
children | 4585:a8901f59bc53 4586:4d63852910ff |
files | plugins/mod_dialback.lua plugins/s2s/mod_s2s.lua |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_dialback.lua Sat Mar 03 00:54:19 2012 +0100 +++ b/plugins/mod_dialback.lua Sat Mar 03 01:35:39 2012 +0100 @@ -160,6 +160,11 @@ end end, 100); +module:hook("s2s-no-stream-features", function (event) + initiate_dialback(event.origin); + return true; +end, 100); + -- Offer dialback to incoming hosts module:hook("s2s-stream-features", function (data) data.features:tag("dialback", { xmlns='urn:xmpp:features:dialback' }):up();
--- a/plugins/s2s/mod_s2s.lua Sat Mar 03 00:54:19 2012 +0100 +++ b/plugins/s2s/mod_s2s.lua Sat Mar 03 01:35:39 2012 +0100 @@ -233,7 +233,7 @@ if session.version < 1.0 then if not session.dialback_verifying then log("debug", "Initiating dialback..."); - initiate_dialback(session); + hosts[session.from_host].events.fire_event("s2s-no-stream-features", { origin = session }); else s2s_mark_connected(session); end