mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 06:38:08 +00:00
Improved a bit the carddav_updated cb in friendlist
This commit is contained in:
parent
bfa055251c
commit
f5e86f8f95
3 changed files with 7 additions and 4 deletions
|
|
@ -116,6 +116,8 @@ static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, MSList *
|
|||
lf->subscribe = lf2->subscribe;
|
||||
lf->refkey = ms_strdup(lf2->refkey);
|
||||
lf->presence_received = lf2->presence_received;
|
||||
lf->lc = lf2->lc;
|
||||
lf->friend_list = lf2->friend_list;
|
||||
|
||||
if (cdc->contact_updated_cb) {
|
||||
ms_debug("Contact updated: %s", linphone_friend_get_name(lf));
|
||||
|
|
|
|||
|
|
@ -518,14 +518,14 @@ static void carddav_updated(LinphoneCardDavContext *cdc, LinphoneFriend *lf_new,
|
|||
LinphoneFriendList *lfl = cdc->friend_list;
|
||||
MSList *elem = ms_list_find(lfl->friends, lf_old);
|
||||
if (elem) {
|
||||
lf_old->friend_list = NULL;
|
||||
linphone_friend_unref(lf_old);
|
||||
lfl->friends = ms_list_remove_link(lfl->friends, elem);
|
||||
elem->data = linphone_friend_ref(lf_new);
|
||||
}
|
||||
linphone_friend_list_import_friend(lfl, lf_new, FALSE);
|
||||
linphone_core_store_friend_in_db(lf_new->lc, lf_new);
|
||||
|
||||
if (cdc->friend_list->cbs->contact_updated_cb) {
|
||||
cdc->friend_list->cbs->contact_updated_cb(lfl, lf_new, lf_old);
|
||||
}
|
||||
linphone_friend_unref(lf_old);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -436,6 +436,7 @@ static void carddav_contact_deleted(LinphoneFriendList *list, LinphoneFriend *lf
|
|||
|
||||
static void carddav_contact_updated(LinphoneFriendList *list, LinphoneFriend *new_friend, LinphoneFriend *old_friend) {
|
||||
LinphoneCardDAVStats *stats = (LinphoneCardDAVStats *)linphone_friend_list_cbs_get_user_data(list->cbs);
|
||||
BC_ASSERT_STRING_EQUAL(linphone_vcard_get_full_name(linphone_friend_get_vcard(new_friend)), linphone_vcard_get_full_name(linphone_friend_get_vcard(old_friend)));
|
||||
stats->updated_contact_count++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue