# HG changeset patch # User Kim Alvefur # Date 1488420205 -3600 # Node ID 3629f03817f8551370fc96338ae2ccf026cf67cb # Parent 5b03a80036599ecf6957ebad13b8de587ae79506 mod_websocket: Make open_stream method behave like the one from util.xmppstream diff -r 5b03a8003659 -r 3629f03817f8 plugins/mod_websocket.lua --- a/plugins/mod_websocket.lua Thu Mar 02 03:03:04 2017 +0100 +++ b/plugins/mod_websocket.lua Thu Mar 02 03:03:25 2017 +0100 @@ -51,14 +51,17 @@ local c2s_listener = portmanager.get_service("c2s").listener; --- Session methods -local function session_open_stream(session) +local function session_open_stream(session, from, to) local attr = { xmlns = xmlns_framing, ["xml:lang"] = "en", version = "1.0", id = session.streamid or "", - from = session.host + from = from or session.host, to = to, }; + if session.stream_attrs then + session:stream_attrs(from, to, attr) + end session.send(st.stanza("open", attr)); end