From a8ade3cfc2b18a4132d83e1c35a8d9afff3edc35 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Thu, 16 Aug 2018 15:35:46 +0200
Subject: mod_pep: Respect setting for whether to include payload in
 notifications

---
 plugins/mod_pep.lua | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index fb4e2f0d..7533d6f1 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -138,6 +138,11 @@ local function get_broadcaster(username)
 		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
-- 
cgit v1.2.3