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 | 30bb916e5656f1860d6d2c7808ade37c84c75c63 (patch) | |
tree | e3d7f9c5df1fa751bef7375db17a11a56210613b /plugins | |
parent | fb51acd8426dfa359c0ea512c7470d6332ade9d1 (diff) | |
download | prosody-30bb916e5656f1860d6d2c7808ade37c84c75c63.tar.gz prosody-30bb916e5656f1860d6d2c7808ade37c84c75c63.zip |
mod_pep_plus: Broadcast only the last item (thanks lovetox)
Diffstat (limited to 'plugins')
-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) |