# HG changeset patch # User Kim Alvefur # Date 1638389072 -3600 # Node ID 705c4c07a86025883f3fb26f2fe631022b4d0fd8 # Parent 628374809421b2a5f0660e0f47bf27b4d77b232d 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 diff -r 628374809421 -r 705c4c07a860 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":";