# HG changeset patch # User nicoco # Date 1711101724 -3600 # Node ID a88c43de648c437469b9b97a50e4906aa56970fa # Parent 8aec430ba20516b9f1901f9e04364372e217c226 mod_privilege: Fix IQ privileges advertising for multiple namespaces Before this fix, the namespaces element were wrongly nested. diff -r 8aec430ba205 -r a88c43de648c mod_privilege/mod_privilege.lua --- a/mod_privilege/mod_privilege.lua Thu Mar 21 19:44:27 2024 +0100 +++ b/mod_privilege/mod_privilege.lua Fri Mar 22 11:02:04 2024 +0100 @@ -69,7 +69,7 @@ end local iq_perm = perms["iq"] if iq_perm ~= nil then - message:tag("perm", {access="iq"}) + local perm_el = st.stanza("perm", {access="iq"}) for namespace, ns_perm in pairs(iq_perm) do local perm_type if ns_perm.set and ns_perm.get then @@ -81,8 +81,9 @@ else perm_type = nil end - message:tag("namespace", {ns=namespace, type=perm_type}) + perm_el:tag("namespace", {ns=namespace, type=perm_type}):up() end + message:add_child(perm_el) end session.send(message) end