# HG changeset patch # User Kim Alvefur # Date 1507500671 -7200 # Node ID 94860b5733d3a689aa41f3f3538bc93bb78c37c6 # Parent 202b9951b037636e9b72e690e2fb8ae54e4a29b8 mod_pep_plus: Update subscriptions for other local users only diff -r 202b9951b037 -r 94860b5733d3 plugins/mod_pep_plus.lua --- a/plugins/mod_pep_plus.lua Sun Oct 08 23:59:13 2017 +0200 +++ b/plugins/mod_pep_plus.lua Mon Oct 09 00:11:11 2017 +0200 @@ -379,11 +379,12 @@ end hash_map[ver] = notify; -- update hash map if is_self then + -- Optimization: Fiddle with other local users for jid, item in pairs(origin.roster) do -- for all interested contacts if jid then - if item.subscription == "both" or item.subscription == "from" then - if not recipients[jid] then recipients[jid] = {}; end - update_subscriptions(contact, jid, notify); + local contact_node, contact_host = jid_split(jid); + if contact_host == host and item.subscription == "both" or item.subscription == "from" then + update_subscriptions(user_bare, contact_node, notify); end end end