changeset 1255:38fb8823cee8

plugin XEP-0054: the fix by revision 1248 (77a4592816f6) was not complete
author souliane <souliane@mailoo.org>
date Wed, 22 Oct 2014 11:42:15 +0200
parents 87fbe4640448
children 4b27b9bf31b0
files src/plugins/plugin_xep_0054.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0054.py	Mon Oct 20 20:46:10 2014 +0200
+++ b/src/plugins/plugin_xep_0054.py	Wed Oct 22 11:42:15 2014 +0200
@@ -205,11 +205,10 @@
     def vcard_err(self, failure, profile):
         """Called when something is wrong with registration"""
         try:
-            if failure.value.stanza.hasAttribute("from"):
-                log.error(_("Can't find VCard of %s") % failure.value.stanza['from'])
-        except AttributeError:
+            log.error(_("Can't find VCard of %s") % failure.value.stanza['from'])
+            self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile)  # FIXME: maybe an error message would be better
+        except AttributeError:  # 'ConnectionLost' object has no attribute 'stanza'
             log.error(_("Can't find VCard: %s") % failure.getErrorMessage())
-        self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile)  # FIXME: maybe an error message would be better
 
     def getCard(self, target_s, profile_key=C.PROF_KEY_NONE):
         """Ask server for VCard