mod_pep: Respect setting for whether to include payload in notifications
authorKim Alvefur <zash@zash.se>
Thu, 16 Aug 2018 15:35:46 +0200
changeset 9193 b88f537163da
parent 9192 8fadd3d6c8d3
child 9194 5192adc5c47f
mod_pep: Respect setting for whether to include payload in notifications
plugins/mod_pep.lua
--- a/plugins/mod_pep.lua	Thu Aug 16 15:34:58 2018 +0200
+++ b/plugins/mod_pep.lua	Thu Aug 16 15:35:46 2018 +0200
@@ -138,6 +138,11 @@
 		if item then
 			item = st.clone(item);
 			item.attr.xmlns = nil; -- Clear the pubsub namespace
+			if kind == "items" then
+				if node_obj and node_obj.config.include_payload == false then
+					item:maptags(function () return nil; end);
+				end
+			end
 			message:add_child(item);
 		end
 		for jid in pairs(jids) do