diff --git a/src/common/caps_cache.py b/src/common/caps_cache.py index 37ff65bab..6a3b3591a 100644 --- a/src/common/caps_cache.py +++ b/src/common/caps_cache.py @@ -251,7 +251,8 @@ class NullClientCaps(AbstractClientCaps): def _lookup_in_cache(self, caps_cache): # lookup something which does not exist to get a new CacheItem created cache_item = caps_cache[('dummy', '')] - assert cache_item.status != CACHED + # Mark the item as cached so that protocol/caps.py does not update it + cache_item.status = CACHED return cache_item def _discover(self, connection, jid): @@ -390,4 +391,4 @@ class CapsCache(object): else: q.update_last_seen() -# vim: se ts=3: \ No newline at end of file +# vim: se ts=3: diff --git a/src/common/protocol/caps.py b/src/common/protocol/caps.py index 268f1ffe2..3fd6c1386 100644 --- a/src/common/protocol/caps.py +++ b/src/common/protocol/caps.py @@ -90,6 +90,8 @@ class ConnectionCaps(object): cache_item = lookup(self._capscache) if cache_item.is_valid(): + # we already know that the hash is fine and have already cached + # the identities and features return else: validate = contact.client_caps.get_hash_validation_strategy() @@ -101,8 +103,9 @@ class ConnectionCaps(object): node = caps_hash = hash_method = None contact.client_caps = self._create_suitable_client_caps(node, caps_hash, hash_method) + log.warn("Computed and retrieved caps hash differ." + + "Ignoring caps of contact %s" % contact.get_full_jid()) self._dispatch_event('CAPS_RECEIVED', (jid,)) - # vim: se ts=3: