From 18baeca54aa5ad8b2f439dee7f17b810cff35bca Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 15 May 2022 16:12:34 +0200 Subject: mod_smacks: Initialize queue before sending 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 must happen before OR after these two lines, not in the middle. --- plugins/mod_smacks.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') 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 -- cgit v1.2.3