vcard validation only if friends stored

This commit is contained in:
Benjamin Reis 2017-01-17 17:14:37 +01:00
parent 6e898ccb0d
commit f3b94ce8c0
4 changed files with 37 additions and 1 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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) {
}

View file

@ -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