mod_smacks: Use stanza type checking function for correctness
authorKim Alvefur <zash@zash.se>
Wed, 01 Dec 2021 21:04:32 +0100
changeset 11983 705c4c07a860
parent 11982 628374809421
child 11984 a91494a4c3d0
mod_smacks: Use stanza type checking function for correctness Non-stanza tables with an 'attr' field might be rare in Prosody, but better to be Correct
plugins/mod_smacks.lua
--- a/plugins/mod_smacks.lua	Wed Dec 01 16:26:53 2021 +0100
+++ b/plugins/mod_smacks.lua	Wed Dec 01 21:04:32 2021 +0100
@@ -196,7 +196,7 @@
 	-- supposed to be nil.
 	-- 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.
-	local is_stanza = stanza.attr and
+	local is_stanza = st.is_stanza(stanza) and
 		(not stanza.attr.xmlns or stanza.attr.xmlns == 'jabber:client')
 		and not stanza.name:find":";