Commit 895065ed authored by Benjamin REIS's avatar Benjamin REIS

use display name of friend list address instead of username

parent 7b34b924
......@@ -1340,38 +1340,28 @@ static void certificates_config_read(LinphoneCore *lc) {
}
static void bodyless_config_read(LinphoneCore *lc) {
const char *lists = lp_config_get_string(lc->config, "sip", "bodyless_lists", NULL);
if (!lists)
return;
char tmp[256] = {0};
char name[256];
char *p, *n;
strncpy(tmp, lists, sizeof(tmp)-1);
for(p = tmp; *p != '\0'; p++) {
if (*p==' ')
continue;
n = strchr(p,',');
if (n)
*n = '\0';
sscanf(p, "%s", name);
bctbx_list_t *bodyless_lists = linphone_config_get_string_list(lc->config, "sip", "bodyless_lists", NULL);
while (bodyless_lists) {
char *name = (char *)bodyless_lists->data;
bodyless_lists = bodyless_lists->next;
LinphoneAddress *addr = linphone_address_new(name);
if(!addr)
continue;
ms_message("Found bodyless friendlist %s", name);
bctbx_free(name);
LinphoneFriendList *friendList = linphone_core_create_friend_list(lc);
linphone_friend_list_set_rls_uri(friendList, name);
linphone_friend_list_set_display_name(friendList, linphone_address_get_username(addr));
linphone_friend_list_set_rls_address(friendList, addr);
linphone_friend_list_set_display_name(
friendList,
linphone_address_get_display_name(addr)
? linphone_address_get_display_name(addr)
: linphone_address_get_username(addr)
);
linphone_address_unref(addr);
linphone_friend_list_set_subscription_bodyless(friendList, TRUE);
linphone_core_add_friend_list(lc, friendList);
linphone_friend_list_unref(friendList);
if (!n)
break;
p = n;
}
}
......
......@@ -1816,9 +1816,9 @@ static void multiple_bodyless_list_subscription_with_rc(void) {
BC_ASSERT_TRUE(wait_for_until(marie->lc, NULL, &marie->stat.number_of_NotifyPresenceReceived, 8, 8000));
LinphoneFriendList *friendList = linphone_core_get_friend_list_by_name(marie->lc, "friends");
LinphoneFriendList *friendList = linphone_core_get_friend_list_by_name(marie->lc, "Friends of Marie");
LinphoneFriendList *buddyList = linphone_core_get_friend_list_by_name(marie->lc, "buddies");
LinphoneFriendList *broList = linphone_core_get_friend_list_by_name(marie->lc, "bros");
LinphoneFriendList *broList = linphone_core_get_friend_list_by_name(marie->lc, "Bros of Marie");
BC_ASSERT_PTR_NOT_NULL(friendList);
BC_ASSERT_PTR_NOT_NULL(buddyList);
......
......@@ -6,7 +6,7 @@ default_proxy=0
ping_with_options=0
composing_idle_timeout=1
store_ha1_passwd=0 #used for sipp
bodyless_lists=sip:friends@sip.example.org, sip:buddies@sip.example.org, sip:bros@sip.example.org
bodyless_lists="Friends of Marie" <sip:friends@sip.example.org>, sip:buddies@sip.example.org, "Bros of Marie" sip:bros@sip.example.org
[auth_info_0]
username=marie
......
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