Catch more errors on vCard request
This commit is contained in:
parent
6e91a05590
commit
947106bb66
1 changed files with 9 additions and 4 deletions
|
@ -471,13 +471,18 @@ class ConnectionVcard:
|
||||||
jid = frm_jid.getStripped()
|
jid = frm_jid.getStripped()
|
||||||
|
|
||||||
stanza_error = stanza.getError()
|
stanza_error = stanza.getError()
|
||||||
if stanza_error in ('service-unavailable', 'item-not-found'):
|
if stanza_error in ('service-unavailable', 'item-not-found',
|
||||||
|
'not-allowed'):
|
||||||
app.log('avatar').info('vCard not available: %s %s',
|
app.log('avatar').info('vCard not available: %s %s',
|
||||||
jid, stanza_error)
|
frm_jid, stanza_error)
|
||||||
return
|
return
|
||||||
|
|
||||||
vcard = self._node_to_dict(
|
vcard_node = stanza.getTag('vCard', namespace=nbxmpp.NS_VCARD)
|
||||||
stanza.getTag('vCard', namespace=nbxmpp.NS_VCARD))
|
if vcard_node is None:
|
||||||
|
app.log('avatar').info('vCard not available: %s', frm_jid)
|
||||||
|
app.log('avatar').debug(stanza)
|
||||||
|
return
|
||||||
|
vcard = self._node_to_dict(vcard_node)
|
||||||
|
|
||||||
if self.get_own_jid().bareMatch(jid):
|
if self.get_own_jid().bareMatch(jid):
|
||||||
if 'NICKNAME' in vcard:
|
if 'NICKNAME' in vcard:
|
||||||
|
|
Loading…
Add table
Reference in a new issue