mirror of
https://github.com/bjc/prosody.git
synced 2025-04-05 14:17:37 +03:00
mod_s2s, mod_dialback: Event on pre-XMPP streams, so we can try dialback.
This commit is contained in:
parent
25b408fcaf
commit
9af8ea363b
2 changed files with 6 additions and 1 deletions
|
@ -160,6 +160,11 @@ module:hook_stanza(xmlns_stream, "features", function (origin, stanza)
|
||||||
end
|
end
|
||||||
end, 100);
|
end, 100);
|
||||||
|
|
||||||
|
module:hook("s2s-no-stream-features", function (event)
|
||||||
|
initiate_dialback(event.origin);
|
||||||
|
return true;
|
||||||
|
end, 100);
|
||||||
|
|
||||||
-- Offer dialback to incoming hosts
|
-- Offer dialback to incoming hosts
|
||||||
module:hook("s2s-stream-features", function (data)
|
module:hook("s2s-stream-features", function (data)
|
||||||
data.features:tag("dialback", { xmlns='urn:xmpp:features:dialback' }):up();
|
data.features:tag("dialback", { xmlns='urn:xmpp:features:dialback' }):up();
|
||||||
|
|
|
@ -233,7 +233,7 @@ function stream_callbacks.streamopened(session, attr)
|
||||||
if session.version < 1.0 then
|
if session.version < 1.0 then
|
||||||
if not session.dialback_verifying then
|
if not session.dialback_verifying then
|
||||||
log("debug", "Initiating dialback...");
|
log("debug", "Initiating dialback...");
|
||||||
initiate_dialback(session);
|
hosts[session.from_host].events.fire_event("s2s-no-stream-features", { origin = session });
|
||||||
else
|
else
|
||||||
s2s_mark_connected(session);
|
s2s_mark_connected(session);
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue