comparison mod_bidi/mod_bidi.lua @ 3721:c96a53bf67b3

mod_bidi: Recommend switching to native module on Prosody trunk
author Kim Alvefur <zash@zash.se>
date Sat, 19 Oct 2019 17:01:43 +0200
parents 8e7d400d4db3
children
comparison
equal deleted inserted replaced
3720:8e7d400d4db3 3721:c96a53bf67b3
73 if not origin.is_bidi and not origin.bidi_session and not origin.do_bidi 73 if not origin.is_bidi and not origin.bidi_session and not origin.do_bidi
74 and not hosts[module.host].s2sout[origin.from_host] 74 and not hosts[module.host].s2sout[origin.from_host]
75 and not disable_bidi_for:contains(origin.from_host) 75 and not disable_bidi_for:contains(origin.from_host)
76 and (not secure_only or (origin.cert_chain_status == "valid" 76 and (not secure_only or (origin.cert_chain_status == "valid"
77 and origin.cert_identity_status == "valid")) then 77 and origin.cert_identity_status == "valid")) then
78 if origin.incoming == true then
79 module:log("warn", "This module can now be replaced by mod_s2s_bidi which is included with Prosody");
80 end
78 module:log("debug", "Announcing support for bidirectional streams"); 81 module:log("debug", "Announcing support for bidirectional streams");
79 features:tag("bidi", { xmlns = xmlns_bidi_feature }):up(); 82 features:tag("bidi", { xmlns = xmlns_bidi_feature }):up();
80 end 83 end
81 end); 84 end);
82 85
98 if not ( origin.bidi_session or origin.is_bidi or origin.do_bidi) 101 if not ( origin.bidi_session or origin.is_bidi or origin.do_bidi)
99 and not disable_bidi_for:contains(origin.to_host) 102 and not disable_bidi_for:contains(origin.to_host)
100 and event.stanza:get_child("bidi", xmlns_bidi_feature) 103 and event.stanza:get_child("bidi", xmlns_bidi_feature)
101 and (not secure_only or origin.cert_chain_status == "valid" 104 and (not secure_only or origin.cert_chain_status == "valid"
102 and origin.cert_identity_status == "valid") then 105 and origin.cert_identity_status == "valid") then
106 if origin.outgoing == true then
107 module:log("warn", "This module can now be replaced by mod_s2s_bidi which is included with Prosody");
108 end
103 module:log("debug", "%s supports bidirectional streams", origin.to_host); 109 module:log("debug", "%s supports bidirectional streams", origin.to_host);
104 origin.sends2s(st.stanza("bidi", { xmlns = xmlns_bidi })); 110 origin.sends2s(st.stanza("bidi", { xmlns = xmlns_bidi }));
105 origin.do_bidi = true; 111 origin.do_bidi = true;
106 end 112 end
107 end, 160); 113 end, 160);