From 55997e2451a279a7577b6a769810a0e0942ad1df Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Sun, 20 Jul 2008 19:10:46 +0000 Subject: Committing on behalf of Milan Crha 2008-07-09 Milan Crha ** Fix for bug #269152 * em-format-quote.c: (emfq_format_header): * em-format-html.c: (efh_format_headers): Use X-MimeOLE as Mailer header when there's nothing better available. svn path=/trunk/; revision=35781 --- mail/ChangeLog | 8 ++++++++ mail/em-format-html.c | 23 +++++++++++++++++++---- mail/em-format-quote.c | 4 +++- 3 files changed, 30 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index cf9dbffc54..c874975c03 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -24,6 +24,14 @@ * mail-ops.c (refresh_folder_exec): * message-list.c (regen_list_exec): +2008-07-09 Milan Crha + + ** Fix for bug #269152 + + * em-format-quote.c: (emfq_format_header): + * em-format-html.c: (efh_format_headers): + Use X-MimeOLE as Mailer header when there's nothing better available. + 2008-07-09 Milan Crha ** Fix for bug #207802 (Patch suggested by Veerapuram Varadhan.) diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 5c76c5e861..1d094773dc 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1942,15 +1942,30 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) if (!mailer_shown && mailer && (!g_ascii_strcasecmp (header->name, "X-Mailer") || !g_ascii_strcasecmp (header->name, "User-Agent") || - !g_ascii_strcasecmp (header->name, "X-Newsreader"))) { - struct _camel_header_raw xmailer; + !g_ascii_strcasecmp (header->name, "X-Newsreader") || + !g_ascii_strcasecmp (header->name, "X-MimeOLE"))) { + struct _camel_header_raw xmailer, *use_header = NULL; + + if (!g_ascii_strcasecmp (header->name, "X-MimeOLE")) { + for (use_header = header->next; use_header; use_header = use_header->next) { + if (!g_ascii_strcasecmp (use_header->name, "X-Mailer") || + !g_ascii_strcasecmp (use_header->name, "User-Agent") || + !g_ascii_strcasecmp (use_header->name, "X-Newsreader")) { + /* even we have X-MimeOLE, then use rather the standard one, when available */ + break; + } + } + } + + if (!use_header) + use_header = header; xmailer.name = "X-Evolution-Mailer"; - xmailer.value = header->value; + xmailer.value = use_header->value; mailer_shown = TRUE; efh_format_header (emf, stream, part, &xmailer, h->flags, charset); - if (strstr(header->value, "Evolution")) + if (strstr(use_header->value, "Evolution")) have_icon = TRUE; } else if (!g_ascii_strcasecmp (header->name, "Face") && !face_decoded) { char *cp = header->value; diff --git a/mail/em-format-quote.c b/mail/em-format-quote.c index f7427eb284..804eead5fd 100644 --- a/mail/em-format-quote.c +++ b/mail/em-format-quote.c @@ -343,7 +343,9 @@ emfq_format_header (EMFormat *emf, CamelStream *stream, CamelMedium *part, const } else if (!strcmp (name, "X-Evolution-Mailer")) { /* pseudo-header */ if (!(txt = camel_medium_get_header (part, "x-mailer"))) if (!(txt = camel_medium_get_header (part, "user-agent"))) - return; + if (!(txt = camel_medium_get_header (part, "x-newsreader"))) + if (!(txt = camel_medium_get_header (part, "x-mimeole"))) + return; txt = value = camel_header_format_ctext (txt, charset); -- cgit