aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-07-25 14:23:35 +0200
committerKim Alvefur <zash@zash.se>2021-07-25 14:23:35 +0200
commitc5cb4577939d829518c4ad945d53627a7dea3ad5 (patch)
tree0a07a62d169822d82597877ee5342db6e25add3b
parent4dc5192c99ce2739952ab77b386f76b987f52dc2 (diff)
downloadprosody-c5cb4577939d829518c4ad945d53627a7dea3ad5.tar.gz
prosody-c5cb4577939d829518c4ad945d53627a7dea3ad5.zip
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.
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua4
1 files changed, 3 insertions, 1 deletions
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