mod_s2s, mod_dialback: Event on pre-XMPP streams, so we can try dialback.

This commit is contained in:
Kim Alvefur 2012-03-03 01:35:39 +01:00
parent 25b408fcaf
commit 9af8ea363b
2 changed files with 6 additions and 1 deletions

View file

@ -160,6 +160,11 @@ module:hook_stanza(xmlns_stream, "features", function (origin, stanza)
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();

View file

@ -233,7 +233,7 @@ function stream_callbacks.streamopened(session, attr)
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