From 1c6d3202e609ff1f688c06b44a79b83b30a6f071 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Wed, 27 Mar 2013 10:54:37 +0100 Subject: [PATCH] fix display name in call_log --- gtk/calllogs.c | 16 ++++++++++++---- po/README | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gtk/calllogs.c b/gtk/calllogs.c index 2ca86bea..9d271415 100644 --- a/gtk/calllogs.c +++ b/gtk/calllogs.c @@ -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)); diff --git a/po/README b/po/README index adec3317..19a1dbd5 100644 --- 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 -- 2.39.2