Software /
code /
prosody
Diff
plugins/mod_websocket.lua @ 7938:3629f03817f8
mod_websocket: Make open_stream method behave like the one from util.xmppstream
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 02 Mar 2017 03:03:25 +0100 |
parent | 7937:5b03a8003659 |
child | 8052:f83a2d4826fb |
line wrap: on
line diff
--- 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