Comparison

plugins/mod_pep.lua @ 9140:415a6d26709e

mod_pep: Only resend last item on successful subscription
author Kim Alvefur <zash@zash.se>
date Sun, 05 Aug 2018 01:53:48 +0200
parent 9139:24a1e7a9d463
child 9141:c1368fb756bf
comparison
equal deleted inserted replaced
9139:24a1e7a9d463 9140:415a6d26709e
360 for node in current - nodes do 360 for node in current - nodes do
361 service:remove_subscription(node, recipient, recipient); 361 service:remove_subscription(node, recipient, recipient);
362 end 362 end
363 363
364 for node in nodes - current do 364 for node in nodes - current do
365 service:add_subscription(node, recipient, recipient, { presence = true }); 365 if service:add_subscription(node, recipient, recipient, { presence = true }) then
366 resend_last_item(recipient, node, service); 366 resend_last_item(recipient, node, service);
367 end
367 end 368 end
368 369
369 if nodes == empty_set or nodes:empty() then 370 if nodes == empty_set or nodes:empty() then
370 nodes = nil; 371 nodes = nil;
371 end 372 end