aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-02 03:03:25 +0100
committerKim Alvefur <zash@zash.se>2017-03-02 03:03:25 +0100
commit5535c0fb4808b55b86273d8dea59343d0c178441 (patch)
treeeb577ffd5423a430f2261b4ec9944d3542c7b3a5 /plugins
parent41ef96b42ec9e3b43b6767dbcc4782a446191165 (diff)
downloadprosody-5535c0fb4808b55b86273d8dea59343d0c178441.tar.gz
prosody-5535c0fb4808b55b86273d8dea59343d0c178441.zip
mod_websocket: Make open_stream method behave like the one from util.xmppstream
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_websocket.lua7
1 files 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