From c5cb4577939d829518c4ad945d53627a7dea3ad5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 25 Jul 2021 14:23:35 +0200 Subject: mod_pubsub: Remove publisher field when not exposing publisher The publisher is already there on the item when the broadcaster gets it, so it needs to do the opposite thing. --- plugins/mod_pubsub/mod_pubsub.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/mod_pubsub') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index dfe60f73..d823657a 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -74,7 +74,9 @@ function simple_broadcast(kind, node, jids, item, actor, node_obj, service) if node_obj and node_obj.config.include_payload == false then item:maptags(function () return nil; end); end - if expose_publisher and actor then + if not expose_publisher then + item.attr.publisher = nil; + elseif not item.attr.publisher then item.attr.publisher = service.config.normalize_jid(actor); end end -- cgit v1.2.3