aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-11-07 02:32:45 +0100
committerKim Alvefur <zash@zash.se>2017-11-07 02:32:45 +0100
commitcb98c5a29371257b5049f08c35dfdbe5b7ba950d (patch)
treee3d7f9c5df1fa751bef7375db17a11a56210613b /plugins
parentb42294687837a7ad7d3b9bb864a7ad9348574745 (diff)
downloadprosody-cb98c5a29371257b5049f08c35dfdbe5b7ba950d.tar.gz
prosody-cb98c5a29371257b5049f08c35dfdbe5b7ba950d.zip
mod_pep_plus: Broadcast only the last item (thanks lovetox)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_pep_plus.lua7
1 files 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)