diff options
author | Kim Alvefur <zash@zash.se> | 2017-11-07 02:32:45 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-11-07 02:32:45 +0100 |
commit | cb98c5a29371257b5049f08c35dfdbe5b7ba950d (patch) | |
tree | e3d7f9c5df1fa751bef7375db17a11a56210613b | |
parent | b42294687837a7ad7d3b9bb864a7ad9348574745 (diff) | |
download | prosody-cb98c5a29371257b5049f08c35dfdbe5b7ba950d.tar.gz prosody-cb98c5a29371257b5049f08c35dfdbe5b7ba950d.zip |
mod_pep_plus: Broadcast only the last item (thanks lovetox)
-rw-r--r-- | plugins/mod_pep_plus.lua | 7 |
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) |