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.
--- 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