Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0115.py @ 1232:6b10442e8920
plugin XEP-0115: trap "service-unavailable" error when retrieving disco infos
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 07 Oct 2014 10:19:01 +0200 |
parents | 301b342c697a |
children | c3884a63efde |
comparison
equal
deleted
inserted
replaced
1231:93a5e2673929 | 1232:6b10442e8920 |
---|---|
148 # we already know the hash, we update the jid entity | 148 # we already know the hash, we update the jid entity |
149 log.debug ("hash [%(hash)s] already in cache, updating entity [%(jid)s]" % {'hash': c_ver, 'jid': from_jid.full()}) | 149 log.debug ("hash [%(hash)s] already in cache, updating entity [%(jid)s]" % {'hash': c_ver, 'jid': from_jid.full()}) |
150 self.host.memory.updateEntityData(from_jid, C.ENTITY_CAP_HASH, c_ver, self.profile) | 150 self.host.memory.updateEntityData(from_jid, C.ENTITY_CAP_HASH, c_ver, self.profile) |
151 return | 151 return |
152 | 152 |
153 yield self.host.getDiscoInfos(from_jid, self.profile) | 153 try: |
154 yield self.host.getDiscoInfos(from_jid, self.profile) | |
155 except Exception, e: | |
156 log.error(_("Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=e.condition)) | |
157 return | |
154 if c_hash != 'sha-1': | 158 if c_hash != 'sha-1': |
155 #unknown hash method | 159 #unknown hash method |
156 log.warning(_('Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)') % {'hash_method':c_hash, 'jid': from_jid, 'node': c_node}) | 160 log.warning(_('Unknown hash method for entity capabilities: [%(hash_method)s] (entity: %(jid)s, node: %(node)s)') % {'hash_method':c_hash, 'jid': from_jid, 'node': c_node}) |
157 computed_hash = self.host.memory.getEntityDatum(from_jid, C.ENTITY_CAP_HASH, self.profile) | 161 computed_hash = self.host.memory.getEntityDatum(from_jid, C.ENTITY_CAP_HASH, self.profile) |
158 if computed_hash != c_ver: | 162 if computed_hash != c_ver: |