Commit 4eff297a authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Fixed issue in vCard API

parent f2f7387d
......@@ -346,7 +346,9 @@ bctbx_list_t* linphone_vcard_get_phone_numbers(const LinphoneVcard *vCard) {
void linphone_vcard_set_organization(LinphoneVcard *vCard, const char *organization) {
if (!vCard) return;
if (vCard->belCard->getOrganizations().size() > 0) {
if (!organization) {
linphone_vcard_remove_organization(vCard);
} else if (vCard->belCard->getOrganizations().size() > 0) {
const shared_ptr<belcard::BelCardOrganization> org = vCard->belCard->getOrganizations().front();
org->setValue(organization);
} else {
......@@ -365,6 +367,15 @@ const char* linphone_vcard_get_organization(const LinphoneVcard *vCard) {
return NULL;
}
void linphone_vcard_remove_organization(LinphoneVcard *vCard) {
if (!vCard) return;
if (vCard->belCard->getOrganizations().size() > 0) {
const shared_ptr<belcard::BelCardOrganization> org = vCard->belCard->getOrganizations().front();
vCard->belCard->removeOrganization(org);
}
}
bool_t linphone_vcard_generate_unique_id(LinphoneVcard *vCard) {
if (vCard) {
if (linphone_vcard_get_uid(vCard)) {
......
......@@ -142,6 +142,9 @@ const char* linphone_vcard_get_organization(const LinphoneVcard *vCard) {
return NULL;
}
void linphone_vcard_remove_organization(LinphoneVcard *vCard) {
}
bool_t linphone_vcard_generate_unique_id(LinphoneVcard *vCard) {
return FALSE;
}
......
......@@ -183,6 +183,12 @@ LINPHONE_PUBLIC void linphone_vcard_set_organization(LinphoneVcard *vCard, const
*/
LINPHONE_PUBLIC const char* linphone_vcard_get_organization(const LinphoneVcard *vCard);
/**
* Removes the Organization field of the vCard
* @param vCard the #LinphoneVcard @notnil
*/
LINPHONE_PUBLIC void linphone_vcard_remove_organization(LinphoneVcard *vCard);
/**
* Generates a random unique id for the vCard.
* If is required to be able to synchronize the vCard with a CardDAV server
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment