--- friendlist.c.bak 2013-05-15 13:02:23.606072868 +0200 +++ friendlist.c 2018-02-03 19:54:22.712164226 +0100 @@ -588,8 +588,15 @@ const LinphoneAddress *addr1,*addr2; addr1=linphone_friend_get_address(lf1); addr2=linphone_friend_get_address(lf2); - u1=linphone_address_get_username(addr1); - u2=linphone_address_get_username(addr2); + /* Fix by Simon IJskes */ + u1=linphone_address_get_display_name(addr1); + if (u1 == NULL) { + u1=linphone_address_get_username(addr1); + } + u2=linphone_address_get_display_name(addr2); + if (u2 == NULL) { + u2=linphone_address_get_username(addr2); + } if (u1 && u2) return strcasecmp(u1,u2); if (u1) return 1; else return -1; @@ -1077,4 +1084,4 @@ void linphone_gtk_buddy_info_updated(LinphoneCore *lc, LinphoneFriend *lf){ /*refresh the entire list*/ linphone_gtk_show_friends(); -} \ No newline at end of file +}