From 474f5af7c90b26f32b863d1b29cf49c3ecfac766 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 5 Aug 2018 01:53:48 +0200 Subject: mod_pep: Only resend last item on successful subscription --- plugins/mod_pep.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/mod_pep.lua') diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 4036870f..e94ba4bb 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -362,8 +362,9 @@ local function update_subscriptions(recipient, service_name, nodes) end for node in nodes - current do - service:add_subscription(node, recipient, recipient, { presence = true }); - resend_last_item(recipient, node, service); + if service:add_subscription(node, recipient, recipient, { presence = true }) then + resend_last_item(recipient, node, service); + end end if nodes == empty_set or nodes:empty() then -- cgit v1.2.3