# HG changeset patch # User Kim Alvefur # Date 1652623954 -7200 # Node ID c589874fe3489154628810592ff5d13ac9825d77 # Parent ad49bb3a47808e8ea6371d2bfe8bd2e78c9bf2fe 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. diff -r ad49bb3a4780 -r c589874fe348 plugins/mod_smacks.lua --- a/plugins/mod_smacks.lua Sun May 15 15:29:02 2022 +0200 +++ b/plugins/mod_smacks.lua Sun May 15 16:12:34 2022 +0200 @@ -334,8 +334,8 @@ if not session.smacks_feature then return end session.smacks = session.smacks_feature.attr.xmlns; + wrap_session_out(session, false); session.sends2s(st.stanza("enable", { xmlns = session.smacks })); - wrap_session_out(session, false); end); function handle_enabled(session, stanza, xmlns_sm) -- luacheck: ignore 212/stanza