diff options
author | Not Zed <NotZed@Ximian.com> | 2004-03-17 18:37:13 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-03-17 18:37:13 +0800 |
commit | 09d1a191ee08f27fb7b2103142dc2b8578875411 (patch) | |
tree | 784a655525aaf267e0e4dc77225bdf46620b0647 /mail/em-format-html.c | |
parent | 9801f37793cd5ef06da86ce96d52bc66e77083d5 (diff) | |
download | gsoc2013-evolution-09d1a191ee08f27fb7b2103142dc2b8578875411.tar.gz gsoc2013-evolution-09d1a191ee08f27fb7b2103142dc2b8578875411.tar.zst gsoc2013-evolution-09d1a191ee08f27fb7b2103142dc2b8578875411.zip |
format as plain text too.
2004-03-17 Not Zed <NotZed@Ximian.com>
* em-format-html.c (efh_message_deliverystatus): format as plain
text too.
* em-format.c (emf_message_deliverystatus): format delivery
status messages as plain text, rather than as messages. since
they wont be CamelMimeMessages. Maybe they should be silently
hidden.
svn path=/trunk/; revision=25098
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r-- | mail/em-format-html.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 87440664b3..c912cf8020 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -888,6 +888,36 @@ fail: } static void +efh_message_deliverystatus(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) +{ + CamelStreamFilter *filtered_stream; + CamelMimeFilter *html_filter; + guint32 rgb = 0x737373; + + /* Yuck, this is copied from efh_text_plain */ + camel_stream_printf (stream, + "<table bgcolor=\"#%06x\" cellspacing=0 cellpadding=1 width=100%%><tr><td>\n" + "<table bgcolor=\"#%06x\" cellspacing=0 cellpadding=0 width=100%%><tr><td>\n" + "<table cellspacing=0 cellpadding=10><td><tr>\n", + efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); + + filtered_stream = camel_stream_filter_new_with_stream(stream); + html_filter = camel_mime_filter_tohtml_new(efh->text_html_flags, rgb); + camel_stream_filter_add(filtered_stream, html_filter); + camel_object_unref(html_filter); + + camel_stream_write_string(stream, "<tt>\n"); + em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)part)); + camel_stream_flush((CamelStream *)filtered_stream); + camel_stream_write_string(stream, "</tt>\n"); + + camel_stream_write_string(stream, + "</td></tr></table>\n" + "</td></tr></table>\n" + "</td></tr></table>\n"); +} + +static void emfh_write_related(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) { em_format_format_content(emf, stream, puri->part); @@ -1060,6 +1090,7 @@ static EMFormatHandler type_builtin_table[] = { { "text/richtext", (EMFormatFunc)efh_text_enriched }, { "text/*", (EMFormatFunc)efh_text_plain }, { "message/external-body", (EMFormatFunc)efh_message_external }, + { "message/delivery-status", (EMFormatFunc)efh_message_deliverystatus }, { "multipart/related", (EMFormatFunc)efh_multipart_related }, /* This is where one adds those busted, non-registered types, |