[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] Sort contacts by name

From: Mark
Subject: Re: [Linphone-developers] Sort contacts by name
Date: Fri, 15 Nov 2019 07:57:50 -0800
User-agent: Cyrus-JMAP/3.1.7-562-gfd0633a-fmstable-20191114v1

I used this to patch an earlier Linphone. Maybe there is a clue here for you.

From: Rob van der Putten <address@hidden>
To: Debian Bug Tracking System <address@hidden>
Subject: linphone: Wrong contact list sort order
Date: Sun, 04 Feb 2018 15:52:02 +0100

Package: linphone
Version: 3.6.1-3
Severity: normal

Dear Maintainer,

Linphone sorts contacts by username (EG: <sip:address@hidden>) as
opposed to display_name (EG: "John Doe"). Below a small patch by a friend
which fixes this problem;

--- 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;
-               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*/
\ No newline at end of file

It's not known if the tests u1 == NULL and u2 == NULL are really
necessary, but it can't hurt.

On Fri, Nov 15, 2019, at 7:44 AM, Andrew Wright wrote:

I've gotten Linphone up and running for work, but there is one inconvenience, the contacts list is sorted by extension or number. It would be easier to find a contact if there was the option to sort alphabetically by name.

Linphone-developers mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]