plugins/mod_pep.lua
changeset 12964 31b22cc221b5
parent 12264 e729c994e7c7
child 12966 1b179d14a1dd
--- a/plugins/mod_pep.lua	Tue Mar 21 20:43:42 2023 +0100
+++ b/plugins/mod_pep.lua	Wed Mar 22 11:39:19 2023 +0000
@@ -136,10 +136,14 @@
 local function get_broadcaster(username)
 	local user_bare = jid_join(username, host);
 	local function simple_broadcast(kind, node, jids, item, _, node_obj)
+		local expose_publisher;
 		if node_obj then
 			if node_obj.config["notify_"..kind] == false then
 				return;
 			end
+			if node_obj.config.itemreply == "publisher" then
+				expose_publisher = true;
+			end
 		end
 		if kind == "retract" then
 			kind = "items"; -- XEP-0060 signals retraction in an <items> container
@@ -151,6 +155,9 @@
 				if node_obj and node_obj.config.include_payload == false then
 					item:maptags(function () return nil; end);
 				end
+				if not expose_publisher then
+					item.attr.publisher = nil;
+				end
 			end
 		end