From 83b02383f6d9fda74a3c691fec47692115eb92f4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 9 Oct 2017 00:11:11 +0200 Subject: mod_pep_plus: Update subscriptions for other local users only --- plugins/mod_pep_plus.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua index 52f6b66d..7d4064df 100644 --- a/plugins/mod_pep_plus.lua +++ b/plugins/mod_pep_plus.lua @@ -379,11 +379,12 @@ module:hook("iq-result/bare/disco", function(event) 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 -- cgit v1.2.3