aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-03-12 00:14:23 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-03-12 00:14:23 +0800
commit2dab41615b9ed522ab0587681b1f875ab20d1607 (patch)
treeea408ea200fb684bc35709d3826b8c3773af23b9
parentfff0d518420ca7ea8cd97014eb547120174c4a4e (diff)
downloadgsoc2013-evolution-2dab41615b9ed522ab0587681b1f875ab20d1607.tar
gsoc2013-evolution-2dab41615b9ed522ab0587681b1f875ab20d1607.tar.gz
gsoc2013-evolution-2dab41615b9ed522ab0587681b1f875ab20d1607.tar.bz2
gsoc2013-evolution-2dab41615b9ed522ab0587681b1f875ab20d1607.tar.lz
gsoc2013-evolution-2dab41615b9ed522ab0587681b1f875ab20d1607.tar.xz
gsoc2013-evolution-2dab41615b9ed522ab0587681b1f875ab20d1607.tar.zst
gsoc2013-evolution-2dab41615b9ed522ab0587681b1f875ab20d1607.zip
Fixed a bug where txt wasn't being properly initialised in all cases for
2004-03-11 Jeffrey Stedfast <fejj@ximian.com> * em-format-html.c (efh_format_header): Fixed a bug where txt wasn't being properly initialised in all cases for Date headers. Also fixed the x-evolution-mailer code to simply use the ehader->value that was passed in. (efh_format_headers): Fixed to handle the special X-Evolution-Mailer header. svn path=/trunk/; revision=25028
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-format-html.c32
2 files changed, 33 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3756840b54..c4d617d6e2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2004-03-11 Jeffrey Stedfast <fejj@ximian.com>
+
+ * em-format-html.c (efh_format_header): Fixed a bug where txt
+ wasn't being properly initialised in all cases for Date
+ headers. Also fixed the x-evolution-mailer code to simply use the
+ ehader->value that was passed in.
+ (efh_format_headers): Fixed to handle the special
+ X-Evolution-Mailer header.
+
2004-03-11 Not Zed <NotZed@Ximian.com>
* em-folder-browser.c (emfb_set_folder): a really gross hack,
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 10ed59260f..87440664b3 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1480,20 +1480,22 @@ efh_format_header(EMFormat *emf, CamelStream *stream, CamelMedium *part, struct
txt = camel_mime_message_get_subject (msg);
label = _("Subject");
flags |= EM_FORMAT_HEADER_BOLD;
- } 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;
-
+ } else if (!strcmp (name, "x-evolution-mailer")) {
+ /* pseudo-header */
label = _("Mailer");
+ txt = header->value;
flags |= EM_FORMAT_HEADER_BOLD;
} else if (!strcmp (name, "date") || !strcmp (name, "resent-date")) {
int msg_offset, local_tz;
time_t msg_date;
struct tm local;
+ txt = header->value;
+ while (*txt == ' ')
+ txt++;
+
/* Show the local timezone equivalent in brackets if the sender is remote */
- msg_date = camel_header_decode_date (header->value, &msg_offset);
+ msg_date = camel_header_decode_date (txt, &msg_offset);
e_localtime_with_offset (msg_date, &local, &local_tz);
/* Convert message offset to minutes (e.g. -0400 --> -240) */
@@ -1513,7 +1515,7 @@ efh_format_header(EMFormat *emf, CamelStream *stream, CamelMedium *part, struct
e_utf8_strftime (buf, sizeof (buf), _("<I> (%R %Z)</I>"), &local);
}
- html = camel_text_to_html (header->value, efh->text_html_flags, 0);
+ html = camel_text_to_html (txt, efh->text_html_flags, 0);
txt = value = g_strdup_printf ("%s %s", html, buf);
g_free (html);
flags |= EM_FORMAT_HTML_HEADER_HTML;
@@ -1564,10 +1566,24 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
}
} else {
while (h->next) {
+ int mailer;
+
header = ((CamelMimePart *)part)->headers;
+
+ mailer = !g_ascii_strcasecmp (h->name, "X-Evolution-Mailer");
+
while (header) {
- if (!g_ascii_strcasecmp(header->name, h->name))
+ if (mailer && (!g_ascii_strcasecmp (header->name, "X-Mailer") ||
+ !g_ascii_strcasecmp (header->name, "User-Agent"))) {
+ struct _camel_header_raw xmailer;
+
+ xmailer.name = "X-Evolution-Mailer";
+ xmailer.value = header->value;
+
+ efh_format_header (emf, stream, part, &xmailer, h->flags, charset);
+ } else if (!g_ascii_strcasecmp (header->name, h->name)) {
efh_format_header(emf, stream, part, header, h->flags, charset);
+ }
header = header->next;
}
h = h->next;