--- a/plugins/mod_pubsub/mod_pubsub.lua Wed May 01 22:33:22 2019 +0200
+++ b/plugins/mod_pubsub/mod_pubsub.lua Sun Jul 25 13:52:27 2021 +0200
@@ -199,6 +199,7 @@
set_service(pubsub.new({
autocreate_on_publish = autocreate_on_publish;
autocreate_on_subscribe = autocreate_on_subscribe;
+ expose_publisher = expose_publisher;
nodestore = node_store;
itemstore = create_simple_itemstore;
--- 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 })