From fd19cd42b0d97ead99d7af196d98d2ffdd51dcec Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 2 Mar 2017 03:03:25 +0100 Subject: mod_websocket: Make open_stream method behave like the one from util.xmppstream --- plugins/mod_websocket.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/mod_websocket.lua b/plugins/mod_websocket.lua index 01f2fa5b..3c96f780 100644 --- a/plugins/mod_websocket.lua +++ b/plugins/mod_websocket.lua @@ -51,14 +51,17 @@ local sessions = module:shared("c2s/sessions"); 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 -- cgit v1.2.3