Diff

plugins/mod_smacks.lua @ 12504:c589874fe348

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.
author Kim Alvefur <zash@zash.se>
date Sun, 15 May 2022 16:12:34 +0200
parent 12471:a3b12eeedd4b
child 12518:73ee3855f970
line wrap: on
line diff
--- 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