diff options
author | Kim Alvefur <zash@zash.se> | 2017-10-09 00:11:11 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-10-09 00:11:11 +0200 |
commit | 83b02383f6d9fda74a3c691fec47692115eb92f4 (patch) | |
tree | 762f1466e73ce79e04cb7b31af1ae137bb57b943 | |
parent | 85cfe97696f3482296cc846cb55ed226144c1aab (diff) | |
download | prosody-83b02383f6d9fda74a3c691fec47692115eb92f4.tar.gz prosody-83b02383f6d9fda74a3c691fec47692115eb92f4.zip |
mod_pep_plus: Update subscriptions for other local users only
-rw-r--r-- | plugins/mod_pep_plus.lua | 7 |
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 |