aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep_plus.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-09 00:11:11 +0200
committerKim Alvefur <zash@zash.se>2017-10-09 00:11:11 +0200
commit0097294539894085c2f2ffe3e5f22b819eb75e17 (patch)
tree762f1466e73ce79e04cb7b31af1ae137bb57b943 /plugins/mod_pep_plus.lua
parent3706f646ee19b2f4c31044506e323e4967054157 (diff)
downloadprosody-0097294539894085c2f2ffe3e5f22b819eb75e17.tar.gz
prosody-0097294539894085c2f2ffe3e5f22b819eb75e17.zip
mod_pep_plus: Update subscriptions for other local users only
Diffstat (limited to 'plugins/mod_pep_plus.lua')
-rw-r--r--plugins/mod_pep_plus.lua7
1 files changed, 4 insertions, 3 deletions
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