mod_smacks: Fix traceback when bouncing unacked stanzas
authorKim Alvefur <zash@zash.se>
Sat, 18 Dec 2021 13:58:33 +0100
changeset 12077 4cbe7979a92a
parent 12076 ef0f174488af
child 12078 b892f5489d79
mod_smacks: Fix traceback when bouncing unacked stanzas Errors sent from handle_unacked_stanzas() should usually not be sent to the session itself, but if one is, it should not be queued.
plugins/mod_smacks.lua
--- a/plugins/mod_smacks.lua	Sat Dec 18 13:48:57 2021 +0100
+++ b/plugins/mod_smacks.lua	Sat Dec 18 13:58:33 2021 +0100
@@ -150,6 +150,7 @@
 	-- However, when using mod_smacks with mod_websocket, then mod_websocket's
 	-- stanzas/out filter can get called before this one and adds the xmlns.
 	if session.resending_unacked then return stanza end
+	if not session.smacks then return stanza end
 	local is_stanza = st.is_stanza(stanza) and
 		(not stanza.attr.xmlns or stanza.attr.xmlns == 'jabber:client')
 		and not stanza.name:find":";