comparison src/plugins/plugin_xep_0054.py @ 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 77a4592816f6
children f8a8434dbac7
comparison
equal deleted inserted replaced
1254:87fbe4640448 1255:38fb8823cee8
203 self.host.bridge.actionResult("SUPPRESS", answer['id'], {}, profile) # FIXME: maybe an error message would be better 203 self.host.bridge.actionResult("SUPPRESS", answer['id'], {}, profile) # FIXME: maybe an error message would be better
204 204
205 def vcard_err(self, failure, profile): 205 def vcard_err(self, failure, profile):
206 """Called when something is wrong with registration""" 206 """Called when something is wrong with registration"""
207 try: 207 try:
208 if failure.value.stanza.hasAttribute("from"): 208 log.error(_("Can't find VCard of %s") % failure.value.stanza['from'])
209 log.error(_("Can't find VCard of %s") % failure.value.stanza['from']) 209 self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile) # FIXME: maybe an error message would be better
210 except AttributeError: 210 except AttributeError: # 'ConnectionLost' object has no attribute 'stanza'
211 log.error(_("Can't find VCard: %s") % failure.getErrorMessage()) 211 log.error(_("Can't find VCard: %s") % failure.getErrorMessage())
212 self.host.bridge.actionResult("SUPPRESS", failure.value.stanza['id'], {}, profile) # FIXME: maybe an error message would be better
213 212
214 def getCard(self, target_s, profile_key=C.PROF_KEY_NONE): 213 def getCard(self, target_s, profile_key=C.PROF_KEY_NONE):
215 """Ask server for VCard 214 """Ask server for VCard
216 @param target_s: jid from which we want the VCard 215 @param target_s: jid from which we want the VCard
217 @result: id to retrieve the profile""" 216 @result: id to retrieve the profile"""