Commit f3b94ce8 authored by Benjamin REIS's avatar Benjamin REIS

vcard validation only if friends stored

parent 6e898ccb
......@@ -1083,6 +1083,8 @@ bool_t linphone_friend_create_vcard(LinphoneFriend *fr, const char *name) {
}
vcard = linphone_vcard_new();
bool_t skip = 1 - lp_config_get_int(fr->lc->config, "misc", "store_friends", 1);
linphone_vcard_set_skip_validation(vcard, skip);
linphone_vcard_set_full_name(vcard, name);
linphone_friend_set_vcard(fr, vcard);
return TRUE;
......
......@@ -201,6 +201,19 @@ const char* linphone_vcard_get_full_name(const LinphoneVcard *vCard) {
return result;
}
void linphone_vcard_set_skip_validation(LinphoneVcard *vCard, bool_t skip) {
if (!vCard || !vCard->belCard) return;
vCard->belCard->setSkipFieldValidation(skip);
}
bool_t linphone_vcard_get_skip_validation(const LinphoneVcard *vCard) {
if (!vCard) return FALSE;
bool_t result = vCard->belCard->getSkipFieldValidation();
return result;
}
void linphone_vcard_set_family_name(LinphoneVcard *vCard, const char *name) {
if (!vCard || !name) return;
......
......@@ -79,6 +79,13 @@ const char* linphone_vcard_get_full_name(const LinphoneVcard *vCard) {
return NULL;
}
void linphone_vcard_set_skip_validation(LinphoneVcard *vCard, bool_t skip) {
}
bool_t linphone_vcard_get_skip_validation(const LinphoneVcard *vCard) {
return FALSE;
}
void linphone_vcard_set_family_name(LinphoneVcard *vCard, const char *name) {
}
......@@ -133,7 +140,7 @@ void linphone_vcard_set_uid(LinphoneVcard *vCard, const char *uid) {
const char* linphone_vcard_get_uid(const LinphoneVcard *vCard) {
return NULL;
}
void linphone_vcard_set_etag(LinphoneVcard *vCard, const char * etag) {
}
......
......@@ -95,6 +95,20 @@ LINPHONE_PUBLIC void linphone_vcard_set_full_name(LinphoneVcard *vCard, const ch
*/
LINPHONE_PUBLIC const char* linphone_vcard_get_full_name(const LinphoneVcard *vCard);
/**
* Sets the skipFieldValidation property of the vcard
* @param[in] vCard the LinphoneVcard
* @param[in] skip skipFieldValidation property of the vcard
*/
LINPHONE_PUBLIC void linphone_vcard_set_skip_validation(LinphoneVcard *vCard, bool_t skip);
/**
* Returns the skipFieldValidation property of the vcard.
* @param[in] vCard the LinphoneVcard
* @return the skipFieldValidation property of the vcard
*/
LINPHONE_PUBLIC bool_t linphone_vcard_get_skip_validation(const LinphoneVcard *vCard);
/**
* Sets the family name in the N attribute of the vCard.
* @param[in] vCard the LinphoneVcard
......
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