diff options
author | Kim Alvefur <zash@zash.se> | 2020-05-08 23:54:17 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-05-08 23:54:17 +0200 |
commit | 289898e68f98fe5edfb31ae622c9c3f0d6e1e039 (patch) | |
tree | b296a14a85754e994f5eb98a6b3497db3c22ad5b /plugins/mod_s2s | |
parent | b2baba11247243446e60bea10884d2d2193e9f48 (diff) | |
download | prosody-289898e68f98fe5edfb31ae622c9c3f0d6e1e039.tar.gz prosody-289898e68f98fe5edfb31ae622c9c3f0d6e1e039.zip |
mod_s2s: Improve signaling of stream open events
Makes it clearer, cleaner and easier to extend.
Diffstat (limited to 'plugins/mod_s2s')
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index 8feb6403..2dad864c 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -322,7 +322,7 @@ local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams"; function stream_callbacks.streamopened(session, attr) -- run _streamopened in async context - session.thread:run({ attr = attr }); + session.thread:run({ stream = "opened", attr = attr }); end function stream_callbacks._streamopened(session, attr) @@ -564,10 +564,10 @@ local function initialize_session(session) local stream = new_xmpp_stream(session, stream_callbacks); session.thread = runner(function (stanza) - if stanza.name == nil then - stream_callbacks._streamopened(session, stanza.attr); - else + if st.is_stanza(stanza) then core_process_stanza(session, stanza); + elseif stanza.stream == "opened" then + stream_callbacks._streamopened(session, stanza.attr); end end, runner_callbacks, session); |