Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0054.py @ 1437:a568fc14ab46
plugin XEP-0054: fixes bug introduced by changeset 1255 (38fb8823cee8)
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 14 Jul 2015 12:57:07 +0200 |
parents | 3265a2639182 |
children | 94901070478e |
comparison
equal
deleted
inserted
replaced
1436:e27963c9c219 | 1437:a568fc14ab46 |
---|---|
240 self.host.bridge.actionResult("SUPPRESS", answer['id'], {}, profile) # FIXME: maybe an error message would be better | 240 self.host.bridge.actionResult("SUPPRESS", answer['id'], {}, profile) # FIXME: maybe an error message would be better |
241 | 241 |
242 def _VCardEb(self, failure, profile): | 242 def _VCardEb(self, failure, profile): |
243 """Called when something is wrong with registration""" | 243 """Called when something is wrong with registration""" |
244 try: | 244 try: |
245 self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile) # FIXME: maybe an error message would be better | |
245 log.warning(_(u"Can't find VCard of %s") % failure.value.stanza['from']) | 246 log.warning(_(u"Can't find VCard of %s") % failure.value.stanza['from']) |
246 self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile) # FIXME: maybe an error message would be better | |
247 self.updateCache(jid.JID(failure.value.stanza['from']), "avatar", '', profile) | 247 self.updateCache(jid.JID(failure.value.stanza['from']), "avatar", '', profile) |
248 except AttributeError: # 'ConnectionLost' object has no attribute 'stanza' | 248 except (AttributeError, KeyError): |
249 # 'ConnectionLost' object has no attribute 'stanza' + sometimes 'from' key doesn't exist | |
249 log.warning(_(u"Can't find VCard: %s") % failure.getErrorMessage()) | 250 log.warning(_(u"Can't find VCard: %s") % failure.getErrorMessage()) |
250 | 251 |
251 def _getCard(self, target_s, profile_key=C.PROF_KEY_NONE): | 252 def _getCard(self, target_s, profile_key=C.PROF_KEY_NONE): |
252 return self.getCard(jid.JID(target_s), profile_key) | 253 return self.getCard(jid.JID(target_s), profile_key) |
253 | 254 |