# HG changeset patch # User Kim Alvefur # Date 1510018365 -3600 # Node ID 58cdbbe3b86aa50f1afb228c811f25e1753cb600 # Parent eb6a9c314c86080cfdba8aaea91e35e62d0b0051 mod_pep_plus: Broadcast only the last item (thanks lovetox) diff -r eb6a9c314c86 -r 58cdbbe3b86a plugins/mod_pep_plus.lua --- a/plugins/mod_pep_plus.lua Tue Nov 07 00:40:52 2017 +0100 +++ b/plugins/mod_pep_plus.lua Tue Nov 07 02:32:45 2017 +0100 @@ -256,11 +256,10 @@ end local function resend_last_item(jid, node, service) - local ok, items = service:get_items(node, jid); + local ok, id, item = service:get_last_item(node, jid); if not ok then return; end - for _, id in ipairs(items) do - service.config.broadcaster("items", node, { [jid] = true }, items[id]); - end + if not id then return; end + service.config.broadcaster("items", node, { [jid] = true }, item); end local function update_subscriptions(recipient, service_name, nodes)