aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_smacks.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-12-01 21:04:32 +0100
committerKim Alvefur <zash@zash.se>2021-12-01 21:04:32 +0100
commita7783d452a83eb5a67c380ccb12989111827a3c6 (patch)
tree7f37860ce522c2363d28774e8e932accfc4eb08b /plugins/mod_smacks.lua
parent15ef5fb400c95fe3c1f9a4eab893f7afa7390167 (diff)
downloadprosody-a7783d452a83eb5a67c380ccb12989111827a3c6.tar.gz
prosody-a7783d452a83eb5a67c380ccb12989111827a3c6.zip
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
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r--plugins/mod_smacks.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua
index 25d5dde2..f6fecdb2 100644
--- a/plugins/mod_smacks.lua
+++ b/plugins/mod_smacks.lua
@@ -196,7 +196,7 @@ local function outgoing_stanza_filter(stanza, session)
-- 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":";