diff options
author | Kim Alvefur <zash@zash.se> | 2022-05-15 16:12:34 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-05-15 16:12:34 +0200 |
commit | 18baeca54aa5ad8b2f439dee7f17b810cff35bca (patch) | |
tree | 10a898e8ee7fd43f91b57c08de006a23bcf8b69f | |
parent | 54d1ff8cfd2e51de040a11522f31870b9033dd67 (diff) | |
download | prosody-18baeca54aa5ad8b2f439dee7f17b810cff35bca.tar.gz prosody-18baeca54aa5ad8b2f439dee7f17b810cff35bca.zip |
mod_smacks: Initialize queue before sending <enable>
Setting the .smacks field enables code paths that expects the queue to
be present. The queue is initialized in wrap_session_out(). With
opportunistic writes enabled this happens immediately on .sends2s(), so
the sending <enable> must happen before OR after these two lines, not in
the middle.
-rw-r--r-- | plugins/mod_smacks.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua index 0d2016fc..841e1208 100644 --- a/plugins/mod_smacks.lua +++ b/plugins/mod_smacks.lua @@ -334,8 +334,8 @@ module:hook("s2sout-established", function (event) if not session.smacks_feature then return end session.smacks = session.smacks_feature.attr.xmlns; - session.sends2s(st.stanza("enable", { xmlns = session.smacks })); wrap_session_out(session, false); + session.sends2s(st.stanza("enable", { xmlns = session.smacks })); end); function handle_enabled(session, stanza, xmlns_sm) -- luacheck: ignore 212/stanza |