Exemple #1
0
void linphone_friend_save(LinphoneFriend *fr, LinphoneCore *lc) {
	if (!lc) return;
#ifdef SQLITE_STORAGE_ENABLED
	if (lc->friends_db_file) {
		linphone_core_store_friend_in_db(lc, fr);
	} else {
		linphone_core_write_friends_config(lc);
	}
#else
	linphone_core_write_friends_config(lc);
#endif
}
Exemple #2
0
static void carddav_updated(LinphoneCardDavContext *cdc, LinphoneFriend *lf_new, LinphoneFriend *lf_old) {
	if (cdc) {
		LinphoneFriendList *lfl = cdc->friend_list;
		bctbx_list_t *elem = bctbx_list_find(lfl->friends, lf_old);
		if (elem) {
			elem->data = linphone_friend_ref(lf_new);
		}
		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);
	}
}