vcard
— vcard-temp support (XEP-0054)¶
This subpackage provides minimal support for setting and retrieving vCard as per XEP-0054.
New in version 0.10.
We supply the service:
- class aioxmpp.vcard.VCardService[source]¶
Service for handling vcard-temp.
- async get_vcard(jid=None)[source]¶
Get the vCard stored for the jid jid. If jid is
None
get the vCard of the connected entity.- Parameters:
jid – the object to retrieve.
- Returns:
the stored vCard.
We mask a
XMPPCancelError
in case it isfeature-not-implemented
oritem-not-found
and return an empty vCard, since this can be understood to be semantically equivalent.
- async set_vcard(vcard, jid=None)[source]¶
Store the vCard vcard for the connected entity.
- Parameters:
vcard – the vCard to store.
Note
vcard should always be derived from the result of get_vcard to preserve the elements of the vcard the client does not modify.
Warning
It is in the responsibility of the user to supply valid vcard data as per XEP-0054.
The VCards are exposed as:
- class aioxmpp.vcard.xso.VCard[source]¶
The container for vCard data as per vcard-temp.
- elements¶
The raw elements of the vCard (as etree).
The following methods are defined to access and modify certain entries of the vCard in a highlevel manner: