aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-05 01:53:48 +0200
committerKim Alvefur <zash@zash.se>2018-08-05 01:53:48 +0200
commit474f5af7c90b26f32b863d1b29cf49c3ecfac766 (patch)
treebd23a457ec6513a6bba767371cf67820c19a3db1 /plugins/mod_pep.lua
parent31443e5e2e8861c09802af7ec7bad2edb960c9f3 (diff)
downloadprosody-474f5af7c90b26f32b863d1b29cf49c3ecfac766.tar.gz
prosody-474f5af7c90b26f32b863d1b29cf49c3ecfac766.zip
mod_pep: Only resend last item on successful subscription
Diffstat (limited to 'plugins/mod_pep.lua')
-rw-r--r--plugins/mod_pep.lua5
1 files changed, 3 insertions, 2 deletions
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