From e6f44d8c1f64d39e5f03fbd2b988fb0a01beec37 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 30 Nov 2015 11:50:49 +0100 Subject: [PATCH] Add the "store_friends" parameter in the "misc" section of config to allow not storing friends in the linphonerc. --- coreapi/friend.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/coreapi/friend.c b/coreapi/friend.c index 8b602843f..c5de8a872 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -657,11 +657,15 @@ void linphone_core_write_friends_config(LinphoneCore* lc) { MSList *elem; int i; + int store_friends; if (! linphone_core_ready(lc)) return; /*dont write config when reading it !*/ - for (elem=lc->friendlist->friends,i=0; elem!=NULL; elem=ms_list_next(elem),i++){ - linphone_friend_write_to_config_file(lc->config,(LinphoneFriend*)elem->data,i); + store_friends = lp_config_get_int(lc->config, "misc", "store_friends", 1); + if (store_friends) { + for (elem=lc->friendlist->friends,i=0; elem!=NULL; elem=ms_list_next(elem),i++){ + linphone_friend_write_to_config_file(lc->config,(LinphoneFriend*)elem->data,i); + } + linphone_friend_write_to_config_file(lc->config,NULL,i); /* set the end */ } - linphone_friend_write_to_config_file(lc->config,NULL,i); /* set the end */ } LinphoneCore *linphone_friend_get_core(const LinphoneFriend *fr){