Comparison

plugins/mod_pep_plus.lua @ 8377:58cdbbe3b86a

mod_pep_plus: Broadcast only the last item (thanks lovetox)
author Kim Alvefur <zash@zash.se>
date Tue, 07 Nov 2017 02:32:45 +0100
parent 8342:0c0990a575de
child 8696:164da3186511
comparison
equal deleted inserted replaced
8376:eb6a9c314c86 8377:58cdbbe3b86a
254 end 254 end
255 return current; -- no caps, could mean caps optimization, so return current 255 return current; -- no caps, could mean caps optimization, so return current
256 end 256 end
257 257
258 local function resend_last_item(jid, node, service) 258 local function resend_last_item(jid, node, service)
259 local ok, items = service:get_items(node, jid); 259 local ok, id, item = service:get_last_item(node, jid);
260 if not ok then return; end 260 if not ok then return; end
261 for _, id in ipairs(items) do 261 if not id then return; end
262 service.config.broadcaster("items", node, { [jid] = true }, items[id]); 262 service.config.broadcaster("items", node, { [jid] = true }, item);
263 end
264 end 263 end
265 264
266 local function update_subscriptions(recipient, service_name, nodes) 265 local function update_subscriptions(recipient, service_name, nodes)
267 local service = get_pep_service(service_name); 266 local service = get_pep_service(service_name);
268 nodes = nodes or empty_set; 267 nodes = nodes or empty_set;