mod_pep: Fix comparison between incoming hash and the cached hash for a JID, fixes repeated PEP events on presence (fixes #225)
authorMatthew Wild <mwild1@gmail.com>
Fri, 25 Feb 2011 00:07:38 +0000
changeset 4207 06eb75d071ec
parent 4205 ffa5384130a7
child 4208 25ce18c93417
child 4212 88f9ded73e8b
mod_pep: Fix comparison between incoming hash and the cached hash for a JID, fixes repeated PEP events on presence (fixes #225)
plugins/mod_pep.lua
--- a/plugins/mod_pep.lua	Thu Feb 24 18:56:19 2011 +0100
+++ b/plugins/mod_pep.lua	Fri Feb 25 00:07:38 2011 +0000
@@ -124,7 +124,7 @@
 			local recipient = stanza.attr.from;
 			local current = recipients[user] and recipients[user][recipient];
 			local hash = get_caps_hash_from_presence(stanza, current);
-			if current == hash then return; end
+			if current == hash or (current and current == hash_map[hash]) then return; end
 			if not hash then
 				if recipients[user] then recipients[user][recipient] = nil; end
 			else