aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_smacks.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-05-15 16:12:34 +0200
committerKim Alvefur <zash@zash.se>2022-05-15 16:12:34 +0200
commit18baeca54aa5ad8b2f439dee7f17b810cff35bca (patch)
tree10a898e8ee7fd43f91b57c08de006a23bcf8b69f /plugins/mod_smacks.lua
parent54d1ff8cfd2e51de040a11522f31870b9033dd67 (diff)
downloadprosody-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.
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r--plugins/mod_smacks.lua2
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