Commit 1d93356d authored by Ghislain MARY's avatar Ghislain MARY

Add linphone_core_set_friend_list() function.

parent e63f2ba1
......@@ -56,6 +56,13 @@ typedef struct _LinphoneFriendList LinphoneFriendList;
**/
LINPHONE_PUBLIC LinphoneFriendList * linphone_core_create_friend_list(LinphoneCore *lc);
/**
* Set the friend list.
* @param[in] lc LinphoneCore object
* @param[in] list LinphoneFriendList object
*/
LINPHONE_PUBLIC void linphone_core_set_friend_list(LinphoneCore *lc, LinphoneFriendList *list);
/**
* Acquire a reference to the friend list.
* @param[in] list LinphoneFriendList object.
......
......@@ -1671,7 +1671,6 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
}
static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtable, LpConfig *config, void * userdata){
const char *rls_uri = NULL;
const char *remote_provisioning_uri = NULL;
LinphoneCoreVTable* local_vtable= linphone_core_v_table_new();
LinphoneCoreVTable *internal_vtable = linphone_core_v_table_new();
......@@ -1680,10 +1679,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
lc->config=lp_config_ref(config);
lc->data=userdata;
lc->ringstream_autorelease=TRUE;
lc->friendlist = linphone_core_create_friend_list(lc);
rls_uri = lp_config_get_string(lc->config, "sip", "rls_uri", NULL);
if (rls_uri && lp_config_get_int(lc->config, "sip", "use_rls_presence", 0))
linphone_friend_list_set_rls_uri(lc->friendlist, rls_uri);
linphone_core_set_friend_list(lc, NULL);
linphone_task_list_init(&lc->hooks);
internal_vtable->notify_received = linphone_core_internal_notify_received;
......@@ -1922,6 +1918,22 @@ const MSList * linphone_core_get_friend_list(const LinphoneCore *lc)
return lc->friendlist->friends;
}
void linphone_core_set_friend_list(LinphoneCore *lc, LinphoneFriendList *list) {
if (lc->friendlist != NULL) {
linphone_friend_list_unref(lc->friendlist);
lc->friendlist = NULL;
}
if (list != NULL) {
lc->friendlist = linphone_friend_list_ref(list);
} else {
const char *rls_uri = NULL;
lc->friendlist = linphone_core_create_friend_list(lc);
rls_uri = lp_config_get_string(lc->config, "sip", "rls_uri", NULL);
if (rls_uri && lp_config_get_int(lc->config, "sip", "use_rls_presence", 0))
linphone_friend_list_set_rls_uri(lc->friendlist, rls_uri);
}
}
void linphone_core_enable_audio_adaptive_jittcomp(LinphoneCore* lc, bool_t val)
{
lc->rtp_conf.audio_adaptive_jitt_comp_enabled = val;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment