Software /
code /
prosody
Diff
plugins/mod_pubsub/pubsub.lib.lua @ 11715:ddd6e21e58bf
mod_pubsub: Respect 'expose publisher' setting in item retrieval
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 25 Jul 2021 13:52:27 +0200 |
parent | 11714:d783716103c1 |
child | 11723:3ead0967e04d |
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua Wed May 01 22:33:22 2019 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Sun Jul 25 13:52:27 2021 +0200 @@ -328,9 +328,16 @@ return true; end + local expose_publisher = service.config.expose_publisher; + local data = st.stanza("items", { node = node }); for _, id in ipairs(results) do - data:add_child(results[id]); + local item = results[id]; + if not expose_publisher then + item = st.clone(item); + item.attr.publisher = nil; + end + data:add_child(item); end local reply = st.reply(stanza) :tag("pubsub", { xmlns = xmlns_pubsub })