Merge branch 'xep-0054-fix-no-vcard' into 'master'
xep_0054: raise item-not-found instead of trying to call None.send() See merge request poezio/slixmpp!232
This commit is contained in:
commit
fd1af054c5
1 changed files with 4 additions and 2 deletions
|
@ -134,8 +134,10 @@ class XEP_0054(BasePlugin):
|
||||||
return
|
return
|
||||||
elif iq['type'] == 'get' and self.xmpp.is_component:
|
elif iq['type'] == 'get' and self.xmpp.is_component:
|
||||||
vcard = await self.api['get_vcard'](iq['to'].bare, ifrom=iq['from'])
|
vcard = await self.api['get_vcard'](iq['to'].bare, ifrom=iq['from'])
|
||||||
if isinstance(vcard, Iq):
|
if vcard is None:
|
||||||
vcard.send()
|
raise XMPPError("item-not-found")
|
||||||
|
elif isinstance(vcard, Iq):
|
||||||
|
await vcard.send()
|
||||||
else:
|
else:
|
||||||
iq = iq.reply()
|
iq = iq.reply()
|
||||||
iq.append(vcard)
|
iq.append(vcard)
|
||||||
|
|
Loading…
Reference in a new issue