mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Forgot to commit a few things in previous commit
This commit is contained in:
parent
1d26224858
commit
6cbaaf687b
1 changed files with 16 additions and 5 deletions
|
|
@ -430,30 +430,41 @@ void linphone_friend_list_update_dirty_friends(LinphoneFriendList *list) {
|
|||
}
|
||||
|
||||
static void carddav_created(LinphoneCardDavContext *cdc, LinphoneFriend *lf) {
|
||||
if (cdc && cdc->friend_list->cbs->contact_created_cb) {
|
||||
if (cdc) {
|
||||
LinphoneFriendList *lfl = cdc->friend_list;
|
||||
lfl->friends = ms_list_append(lfl->friends, linphone_friend_ref(lf));
|
||||
cdc->friend_list->cbs->contact_created_cb(lfl, linphone_friend_ref(lf));
|
||||
if (cdc->friend_list->cbs->contact_created_cb) {
|
||||
cdc->friend_list->cbs->contact_created_cb(lfl, linphone_friend_ref(lf));
|
||||
}
|
||||
}
|
||||
linphone_friend_unref(lf);
|
||||
}
|
||||
|
||||
static void carddav_removed(LinphoneCardDavContext *cdc, LinphoneFriend *lf) {
|
||||
if (cdc && cdc->friend_list->cbs->contact_deleted_cb) {
|
||||
if (cdc) {
|
||||
LinphoneFriendList *lfl = cdc->friend_list;
|
||||
MSList *elem = ms_list_find(lfl->friends, lf);
|
||||
lfl->friends = ms_list_remove_link(lfl->friends, elem);
|
||||
cdc->friend_list->cbs->contact_deleted_cb(lfl, linphone_friend_ref(lf));
|
||||
if (elem) {
|
||||
lfl->friends = ms_list_remove_link(lfl->friends, elem);
|
||||
}
|
||||
if (cdc->friend_list->cbs->contact_deleted_cb) {
|
||||
cdc->friend_list->cbs->contact_deleted_cb(lfl, linphone_friend_ref(lf));
|
||||
}
|
||||
}
|
||||
linphone_friend_unref(lf);
|
||||
}
|
||||
|
||||
static void carddav_updated(LinphoneCardDavContext *cdc, LinphoneFriend *lf_new, LinphoneFriend *lf_old) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
void linphone_friend_list_synchronize_friends_from_server(LinphoneFriendList *list) {
|
||||
LinphoneCardDavContext *cdc = linphone_carddav_context_new(list);
|
||||
|
||||
if (cdc) {
|
||||
cdc->contact_created_cb = carddav_created;
|
||||
cdc->contact_removed_cb = carddav_removed;
|
||||
cdc->contact_updated_cb = carddav_updated;
|
||||
cdc->sync_done_cb = carddav_done;
|
||||
linphone_carddav_synchronize(cdc);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue