From cb98c5a29371257b5049f08c35dfdbe5b7ba950d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 7 Nov 2017 02:32:45 +0100 Subject: mod_pep_plus: Broadcast only the last item (thanks lovetox) --- plugins/mod_pep_plus.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua index cd7dfc01..3fbb2a95 100644 --- a/plugins/mod_pep_plus.lua +++ b/plugins/mod_pep_plus.lua @@ -256,11 +256,10 @@ local function get_caps_hash_from_presence(stanza, current) 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) -- cgit v1.2.3