comparison mod_bidi/mod_bidi.lua @ 3720:8e7d400d4db3

mod_bidi: Make compatible Prosody after rev b36765ab0ae3 (fixes #1450) Prosody now natively supports bidi, but relies on these .incoming and .outgoing fields existing.
author Kim Alvefur <zash@zash.se>
date Sun, 20 Oct 2019 01:29:25 +0200
parents db2ff8f29472
children c96a53bf67b3
comparison
equal deleted inserted replaced
3719:a6db99c1420a 3720:8e7d400d4db3
34 conflicting_session.log("info", "We already have an outgoing connection to %s, closing it...", origin.from_host); 34 conflicting_session.log("info", "We already have an outgoing connection to %s, closing it...", origin.from_host);
35 conflicting_session:close{ condition = "conflict", text = "Replaced by bidirectional stream" } 35 conflicting_session:close{ condition = "conflict", text = "Replaced by bidirectional stream" }
36 end 36 end
37 bidi_sessions[origin.from_host] = origin; 37 bidi_sessions[origin.from_host] = origin;
38 origin.is_bidi = true; 38 origin.is_bidi = true;
39 origin.outgoing = true;
39 elseif origin.type == "s2sout" then -- handle incoming stanzas correctly 40 elseif origin.type == "s2sout" then -- handle incoming stanzas correctly
40 local bidi_session = { 41 local bidi_session = {
41 type = "s2sin"; direction = "incoming"; 42 type = "s2sin"; direction = "incoming";
43 incoming = true;
42 is_bidi = true; orig_session = origin; 44 is_bidi = true; orig_session = origin;
43 to_host = origin.from_host; 45 to_host = origin.from_host;
44 from_host = origin.to_host; 46 from_host = origin.to_host;
45 hosts = {}; 47 hosts = {};
46 } 48 }