# HG changeset patch # User Goffi # Date 1653748984 -7200 # Node ID e8a487c42b36ec24db8a8319ec1f0e65be950d46 # Parent 7d6ae8bb95dcb65ac5ba4285930f8e245cbfadfa# Parent ccce785f53e11c002b8dade1d88349d6eb25f972 merge upstream diff -r ccce785f53e1 -r e8a487c42b36 mod_delegation/mod_delegation.lua --- a/mod_delegation/mod_delegation.lua Sat May 28 15:03:05 2022 +0200 +++ b/mod_delegation/mod_delegation.lua Sat May 28 16:43:04 2022 +0200 @@ -170,6 +170,20 @@ local managing_ent_error local stanza_cache = {} -- we cache original stanza to build reply +local function clean_xmlns(node) + -- Recursively remove "jabber:client" attribute from node. + -- In Prosody internal routing, xmlns should not be set. + -- Keeping xmlns would lead to issues like mod_smacks ignoring the outgoing stanza, + -- so we remove all xmlns attributes with a value of "jabber:client" + -- note: this function comes from mod_privilege + if node.attr.xmlns == 'jabber:client' then + for childnode in node:childtags() do + clean_xmlns(childnode) + end + node.attr.xmlns = nil + end +end + local function managing_ent_result(event) -- this function manage iq results from the managing entity -- it do a couple of security check before sending the @@ -209,7 +223,7 @@ return true end - iq.attr.xmlns = nil + clean_xmlns(iq) local original = stanza_cache[stanza.attr.from][stanza.attr.id] stanza_cache[stanza.attr.from][stanza.attr.id] = nil