mod_pubsub: Remove publisher field when not exposing publisher
authorKim Alvefur <zash@zash.se>
Sun, 25 Jul 2021 14:23:35 +0200
changeset 11722 d79f5431f31b
parent 11721 605484fc1c62
child 11723 3986b5a0c3fc
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
--- a/plugins/mod_pubsub/mod_pubsub.lua	Sun Jul 25 14:01:45 2021 +0200
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Sun Jul 25 14:23:35 2021 +0200
@@ -74,7 +74,9 @@
 			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