plugins/mod_pep_plus.lua
changeset 8310 94860b5733d3
parent 8309 202b9951b037
child 8318 967f04fe7fd4
--- 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