class
XMPP::VCard
- XMPP::VCard
- Reference
- Object
Overview
VCard is a high-level client for XEP-0054 - vcard-temp.
vcard-temp is a legacy form of structured user data (name, address, photo) exchanged as an IQ get/set against a user's bare JID. Servers that support it do not advertise a disco feature; support is instead determined by whether the vcard-temp IQ succeeds.
vc = XMPP::VCard.new(client) card = vc.fetch # => Stanza::VCard? for the current user card.fn = "Juliet Capulet" card.set(card)
See: https://xmpp.org/extensions/xep-0054.html
Defined in:
xmpp/vcard.crConstant Summary
-
NS_VCARD_TEMP =
"vcard-temp" -
Disco feature is not used by vcard-temp, but is exposed for symmetry.
Constructors
Instance Method Summary
-
#fetch(jid : String | Nil = nil, timeout : Time::Span = 5.seconds) : Stanza::VCard | Nil
fetch retrieves the vCard stored for the given bare JID (defaults to the current user).
-
#set(vcard : Stanza::VCard, timeout : Time::Span = 5.seconds) : Stanza::IQ | Nil
set stores the given vCard against the current user.
Constructor Detail
Instance Method Detail
fetch retrieves the vCard stored for the given bare JID (defaults to the current user). Returns the Stanza::VCard payload on a successful result, or nil on error or timeout.
set stores the given vCard against the current user. Returns the result/error IQ (nil on timeout); callers check type == "result".