Software /
code /
prosody
Changeset
8307:94860b5733d3
mod_pep_plus: Update subscriptions for other local users only
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 09 Oct 2017 00:11:11 +0200 |
parents | 8306:202b9951b037 |
children | 8308:ab189d3f55d1 |
files | plugins/mod_pep_plus.lua |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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