Software /
code /
prosody
Comparison
plugins/mod_pep_plus.lua @ 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 |
parent | 8306:202b9951b037 |
child | 8315:967f04fe7fd4 |
comparison
equal
deleted
inserted
replaced
8306:202b9951b037 | 8307:94860b5733d3 |
---|---|
377 if nfeature then notify:add(nfeature); end | 377 if nfeature then notify:add(nfeature); end |
378 end | 378 end |
379 end | 379 end |
380 hash_map[ver] = notify; -- update hash map | 380 hash_map[ver] = notify; -- update hash map |
381 if is_self then | 381 if is_self then |
382 -- Optimization: Fiddle with other local users | |
382 for jid, item in pairs(origin.roster) do -- for all interested contacts | 383 for jid, item in pairs(origin.roster) do -- for all interested contacts |
383 if jid then | 384 if jid then |
384 if item.subscription == "both" or item.subscription == "from" then | 385 local contact_node, contact_host = jid_split(jid); |
385 if not recipients[jid] then recipients[jid] = {}; end | 386 if contact_host == host and item.subscription == "both" or item.subscription == "from" then |
386 update_subscriptions(contact, jid, notify); | 387 update_subscriptions(user_bare, contact_node, notify); |
387 end | 388 end |
388 end | 389 end |
389 end | 390 end |
390 end | 391 end |
391 update_subscriptions(contact, username, notify); | 392 update_subscriptions(contact, username, notify); |