From 6142029e7eabd1b78cc3cc477484f26477627c63 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 18 Jul 2001 20:46:35 +0000 Subject: Do what was suggested in #4596. 2001-07-18 Jeffrey Stedfast * mail-tools.c (mail_tool_generate_forward_subject): Do what was suggested in #4596. svn path=/trunk/; revision=11210 --- mail/mail-tools.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'mail/mail-tools.c') diff --git a/mail/mail-tools.c b/mail/mail-tools.c index c72a5d2d02..cd31fa067f 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -193,30 +193,25 @@ char * mail_tool_generate_forward_subject (CamelMimeMessage *msg) { const char *subject; - char *fwd_subj, *fromstr; - const CamelInternetAddress *from; - - from = camel_mime_message_get_from(msg); + char *fwd_subj; + subject = camel_mime_message_get_subject(msg); - - if (from) { - fromstr = camel_address_format((CamelAddress *)from); - if (subject && *subject) { - fwd_subj = g_strdup_printf ("[%s] %s", fromstr, subject); - } else { - fwd_subj = g_strdup_printf (_("[%s] (forwarded message)"), - fromstr); - } - g_free(fromstr); + + if (subject && *subject) { + fwd_subj = g_strdup_printf ("[Fwd: %s]", subject); } else { - if (subject && *subject) { - if (strncmp (subject, "Fwd: ", 5) == 0) - subject += 4; - fwd_subj = g_strdup_printf ("Fwd: %s", subject); + const CamelInternetAddress *from; + char *fromstr; + + from = camel_mime_message_get_from (msg); + if (from) { + fromstr = camel_address_format (CAMEL_ADDRESS (from)); + fwd_subj = g_strdup_printf ("[Fwd: %s]", fromstr); + g_free (fromstr); } else - fwd_subj = g_strdup (_("Fwd: (no subject)")); + fwd_subj = g_strdup (_("[Fwd: No Subject]")); } - + return fwd_subj; } -- cgit