Software /
code /
prosody
Comparison
plugins/mod_s2s_bidi.lua @ 12809:71bd009a9789
mod_s2s_bidi: Add provisions for advertising features to bidi peers
As introduced in XEP-xxxx: Stream Limits Advertisement
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 20 Oct 2022 14:12:56 +0200 |
parent | 12330:38b5b05407be |
child | 12977:74b9e05af71e |
comparison
equal
deleted
inserted
replaced
12808:12bd40b8e105 | 12809:71bd009a9789 |
---|---|
23 if session.type == "s2sout_unauthed" and (not require_encryption or session.secure) then | 23 if session.type == "s2sout_unauthed" and (not require_encryption or session.secure) then |
24 local bidi = stanza:get_child("bidi", xmlns_bidi_feature); | 24 local bidi = stanza:get_child("bidi", xmlns_bidi_feature); |
25 if bidi then | 25 if bidi then |
26 session.incoming = true; | 26 session.incoming = true; |
27 session.log("debug", "Requesting bidirectional stream"); | 27 session.log("debug", "Requesting bidirectional stream"); |
28 session.sends2s(st.stanza("bidi", { xmlns = xmlns_bidi })); | 28 local request_bidi = st.stanza("bidi", { xmlns = xmlns_bidi }); |
29 module:fire_event("s2sout-stream-features", { origin = session, features = request_bidi }); | |
30 session.sends2s(request_bidi); | |
29 end | 31 end |
30 end | 32 end |
31 end, 200); | 33 end, 200); |
32 | 34 |
33 module:hook_tag("urn:xmpp:bidi", "bidi", function(session) | 35 module:hook_tag("urn:xmpp:bidi", "bidi", function(session) |