forked from mirrors/linphone-iphone
feat(vcard): add a clone method
This commit is contained in:
parent
b7dc359f34
commit
e112362041
2 changed files with 20 additions and 0 deletions
|
|
@ -118,6 +118,19 @@ void linphone_vcard_unref(LinphoneVcard *vCard) {
|
|||
belle_sip_object_unref((belle_sip_object_t *)vCard);
|
||||
}
|
||||
|
||||
LinphoneVcard *linphone_vcard_clone(const LinphoneVcard *vCard) {
|
||||
LinphoneVcard *copy = belle_sip_object_new(LinphoneVcard);
|
||||
|
||||
copy->belCard = belcard::BelCardParser::getInstance()->parseOne(vCard->belCard->toFoldedString());
|
||||
|
||||
if (vCard->url) copy->url = ms_strdup(vCard->url);
|
||||
if (vCard->etag) copy->etag = ms_strdup(vCard->etag);
|
||||
|
||||
memcpy(copy->md5, vCard->md5, sizeof *vCard->md5);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
bctbx_list_t* linphone_vcard_context_get_vcard_list_from_file(LinphoneVcardContext *context, const char *filename) {
|
||||
bctbx_list_t *result = NULL;
|
||||
if (context && filename) {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,13 @@ LINPHONE_PUBLIC LinphoneVcard *linphone_vcard_ref(LinphoneVcard *vCard);
|
|||
*/
|
||||
LINPHONE_PUBLIC void linphone_vcard_unref(LinphoneVcard *vCard);
|
||||
|
||||
/**
|
||||
* Clone a #LinphoneVcard.
|
||||
* @param[in] vCard LinphoneVcard object
|
||||
* @return a new LinphoneVcard object
|
||||
*/
|
||||
LINPHONE_PUBLIC LinphoneVcard *linphone_vcard_clone(const LinphoneVcard *vCard);
|
||||
|
||||
/**
|
||||
* Returns the vCard4 representation of the LinphoneVcard.
|
||||
* @param[in] vCard the LinphoneVcard
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue