Software /
code /
prosody
Comparison
plugins/mod_pep.lua @ 9190:b88f537163da
mod_pep: Respect setting for whether to include payload in notifications
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 16 Aug 2018 15:35:46 +0200 |
parent | 9189:8fadd3d6c8d3 |
child | 9196:2fc56434c6e3 |
comparison
equal
deleted
inserted
replaced
9189:8fadd3d6c8d3 | 9190:b88f537163da |
---|---|
136 :tag("event", { xmlns = xmlns_pubsub_event }) | 136 :tag("event", { xmlns = xmlns_pubsub_event }) |
137 :tag(kind, { node = node }); | 137 :tag(kind, { node = node }); |
138 if item then | 138 if item then |
139 item = st.clone(item); | 139 item = st.clone(item); |
140 item.attr.xmlns = nil; -- Clear the pubsub namespace | 140 item.attr.xmlns = nil; -- Clear the pubsub namespace |
141 if kind == "items" then | |
142 if node_obj and node_obj.config.include_payload == false then | |
143 item:maptags(function () return nil; end); | |
144 end | |
145 end | |
141 message:add_child(item); | 146 message:add_child(item); |
142 end | 147 end |
143 for jid in pairs(jids) do | 148 for jid in pairs(jids) do |
144 module:log("debug", "Sending notification to %s from %s: %s", jid, user_bare, tostring(item)); | 149 module:log("debug", "Sending notification to %s from %s: %s", jid, user_bare, tostring(item)); |
145 message.attr.to = jid; | 150 message.attr.to = jid; |