aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_pubsub')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua1
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua9
2 files changed, 9 insertions, 1 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 19834ad4..6866312c 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -199,6 +199,7 @@ function module.load()
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;
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 6214882f..c750ecb8 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -328,9 +328,16 @@ function handlers.get_items(origin, stanza, items, service)
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 })