Commit 0a537423 authored by Benjamin REIS's avatar Benjamin REIS

add get friend list by display name api

parent c50eab58
......@@ -2739,6 +2739,25 @@ LinphoneFriendList* linphone_core_get_default_friend_list(const LinphoneCore *lc
return NULL;
}
LinphoneFriendList *linphone_core_get_friend_list_by_name(const LinphoneCore *lc, const char *name) {
if (!lc)
return NULL;
LinphoneFriendList *ret = NULL;
bctbx_list_t *list_copy = lc->friends_lists;
while (list_copy) {
LinphoneFriendList *list = (LinphoneFriendList *)list_copy->data;
const char *list_name = linphone_friend_list_get_display_name(list);
if (list_name && strcmp(name, list_name) == 0) {
ret = list;
break;
}
list_copy = list_copy->next;
}
return ret;
}
void linphone_core_remove_friend_list(LinphoneCore *lc, LinphoneFriendList *list) {
bctbx_list_t *elem = bctbx_list_find(lc->friends_lists, list);
if (elem == NULL) return;
......
......@@ -5449,6 +5449,14 @@ LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_friends_lists(const Linph
*/
LINPHONE_PUBLIC LinphoneFriendList * linphone_core_get_default_friend_list(const LinphoneCore *lc);
/**
* Retrieves the list of #LinphoneFriend from the core that has the given display name.
* @param[in] lc #LinphoneCore object
* @param[in] name the name of the list
* @return the first #LinphoneFriendList object or NULL
*/
LINPHONE_PUBLIC LinphoneFriendList* linphone_core_get_friend_list_by_name(const LinphoneCore *lc, const char *name);
/**
* Retrieves a list of #LinphoneAddress sort and filter
* @param[in] lc #LinphoneCore object
......
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