diff options
author | Marouane L <techmetx11@disroot.org> | 2022-09-06 17:29:07 +0100 |
---|---|---|
committer | Marouane L <techmetx11@disroot.org> | 2022-10-18 23:24:30 +0100 |
commit | f934c5b59f2fe2c3c00a50135add4aec55ac4024 (patch) | |
tree | 730d135fb92cb15b68717da1f5248c8bc6525019 /src/xmpp/stanza.c | |
parent | fc8455ba34fdb467cc2702e4e071e850eaaf9be7 (diff) | |
download | profani-tty-f934c5b59f2fe2c3c00a50135add4aec55ac4024.tar.gz |
Add vCard support
Only nicknames, photos, birthdays, addresses, telephone numbers, emails, JIDs, titles, roles, notes, and URLs are supported Due to the synopsis array not having enough space, `/vcard photo open-self` and `/vcard photo save-self` are not documented properly in the synopsis section of the `/vcard` command, but they are documented in the arguments section Fixed memory leak in vcard autocomplete (thanks to debXwoody)
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r-- | src/xmpp/stanza.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 6b8377b6..fc2fcdc6 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -2688,6 +2688,25 @@ stanza_create_avatar_metadata_publish_iq(xmpp_ctx_t* ctx, const char* img_data, } xmpp_stanza_t* +stanza_create_vcard_request_iq(xmpp_ctx_t* ctx, const char* const jid, const char* const stanza_id) +{ + xmpp_stanza_t* iq = xmpp_iq_new(ctx, STANZA_TYPE_GET, stanza_id); + xmpp_stanza_set_from(iq, connection_get_fulljid()); + if (jid) { + xmpp_stanza_set_to(iq, jid); + } + + xmpp_stanza_t* vcard = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(vcard, STANZA_NAME_VCARD); + xmpp_stanza_set_ns(vcard, STANZA_NS_VCARD); + + xmpp_stanza_add_child(iq, vcard); + xmpp_stanza_release(vcard); + + return iq; +} + +xmpp_stanza_t* stanza_attach_correction(xmpp_ctx_t* ctx, xmpp_stanza_t* stanza, const char* const replace_id) { xmpp_stanza_t* replace_stanza = xmpp_stanza_new(ctx); |