]> sjero.net Git - linphone/commitdiff
fix display name in call_log
authorMargaux Clerc <margaux.clerc@belledonne-communications.com>
Wed, 27 Mar 2013 09:54:37 +0000 (10:54 +0100)
committerMargaux Clerc <margaux.clerc@belledonne-communications.com>
Wed, 27 Mar 2013 09:55:49 +0000 (10:55 +0100)
gtk/calllogs.c
po/README

index 2ca86beab47bf6e285311c8d7accb9851f72fdc0..9d2714153c5cad808ad40b1891cdc9d252c5b748 100644 (file)
@@ -210,13 +210,14 @@ void linphone_gtk_call_log_update(GtkWidget *w){
        for (logs=linphone_core_get_call_logs(linphone_gtk_get_core());logs!=NULL;logs=logs->next){
                LinphoneCallLog *cl=(LinphoneCallLog*)logs->data;
                GtkTreeIter iter, iter2;
-               LinphoneAddress *la=linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
-               char *addr= linphone_address_as_string_uri_only (la);
+               const LinphoneAddress *la=linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
+               char *addr= linphone_address_as_string(la);
                const char *display;
                gchar *logtxt, *headtxt, *minutes, *seconds;
                gchar quality[20];
                const char *status=NULL;
                gchar *start_date=NULL;
+               LinphoneFriend *lf=NULL;
                int duration=linphone_call_log_get_duration(cl);
                time_t start_date_time=linphone_call_log_get_start_date(cl);
                
@@ -229,12 +230,19 @@ void linphone_gtk_call_log_update(GtkWidget *w){
 #else
                start_date=g_strdup(ctime(&start_date_time));
 #endif
+               lf=linphone_core_get_friend_by_address(linphone_gtk_get_core(),addr);
+               if(lf != NULL){
+                       la=linphone_friend_get_address(lf);
+                       display=linphone_address_get_display_name(la);
+               } else {
+                       display=linphone_address_get_display_name(la);
+               }
                
-               display=linphone_address_get_display_name (la);
                if (display==NULL){
                        display=linphone_address_get_username (la);
-                       if (display==NULL)
+                       if (display==NULL){
                                display=linphone_address_get_domain (la);
+                       }
                }
                if (linphone_call_log_get_quality(cl)!=-1){
                        snprintf(quality,sizeof(quality),"%.1f",linphone_call_log_get_quality(cl));
index adec33171e5455d7d7f8ba036e406e61e5cec138..19a1dbd530a36bc7c7821e33a82f201cac771a51 100644 (file)
--- a/po/README
+++ b/po/README
@@ -5,7 +5,7 @@ To add a translation file in linphone project you should first :
        - then add the file .po in the directory /po
        - run ./autogen.sh
 
-Update the tranlation files 
+Update the translation files 
 ***************************
 To update all the translation files, in the directory /po run the following command 
        $ make update-po