Software /
code /
prosody
Diff
plugins/mod_s2s/mod_s2s.lua @ 10809:86ea811ee25b
mod_s2s: Improve signaling of stream open events
Makes it clearer, cleaner and easier to extend.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 08 May 2020 23:54:17 +0200 |
parent | 10648:2bd17e043275 |
child | 10810:8a0a923e1ced |
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua Thu May 07 23:02:47 2020 +0200 +++ b/plugins/mod_s2s/mod_s2s.lua Fri May 08 23:54:17 2020 +0200 @@ -322,7 +322,7 @@ 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 stream = new_xmpp_stream(session, stream_callbacks); session.thread = runner(function (stanza) - if stanza.name == nil then + if st.is_stanza(stanza) then + core_process_stanza(session, stanza); + elseif stanza.stream == "opened" then stream_callbacks._streamopened(session, stanza.attr); - else - core_process_stanza(session, stanza); end end, runner_callbacks, session);