From 61f07097af4b36b441b206ab25fc063928b8a928 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Fri, 3 Apr 2009 16:20:50 +0000 Subject: [PATCH] Simplify the recipients if they are in the form of a@b or "a@b" pmo-trunk-r8605 --- src/widgets/modest-details-dialog.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/widgets/modest-details-dialog.c b/src/widgets/modest-details-dialog.c index 732c59f..c269c4a 100644 --- a/src/widgets/modest-details-dialog.c +++ b/src/widgets/modest-details-dialog.c @@ -190,6 +190,17 @@ modest_details_dialog_add_data_default (ModestDetailsDialog *self, 0, 0); } +static void +replace_recipients (gchar **recipients) +{ + + gchar *result; + + result = modest_text_utils_simplify_recipients (*recipients); + + g_free (*recipients); + *recipients = result; +} static void modest_details_dialog_set_header_default (ModestDetailsDialog *self, @@ -229,14 +240,11 @@ modest_details_dialog_set_header_default (ModestDetailsDialog *self, sent = tny_header_get_date_sent (header); size = tny_header_get_message_size (header); - if (from == NULL) - from = g_strdup (""); - if (to == NULL) - to = g_strdup (""); + replace_recipients (&from); + replace_recipients (&to); + replace_recipients (&cc); if (subject == NULL) subject = g_strdup (""); - if (cc == NULL) - cc = g_strdup (""); if (!strcmp (subject, "")) { g_free (subject); @@ -285,8 +293,10 @@ modest_details_dialog_set_header_default (ModestDetailsDialog *self, modest_details_dialog_add_data (self, _("mcen_fi_message_properties_cc"), cc); /* only show cc when it's there */ - if (bcc && strlen(bcc) > 0) + if (bcc && strlen(bcc) > 0) { + replace_recipients (&bcc); modest_details_dialog_add_data (self, _("mcen_fi_message_properties_bcc"), bcc); + } /* Set size */ size_s = modest_text_utils_get_display_size (size); -- 1.7.9.5