aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-21 10:50:08 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-21 10:50:08 +0800
commita8705a44c50e1303157b769c59d8a86d3b008839 (patch)
treef6df7dcd2c6fca41f5717b8d242dbbc6e1221566
parentb476b5573e56fb9da9bc7730d920f18b5a771ab1 (diff)
downloadgsoc2013-evolution-a8705a44c50e1303157b769c59d8a86d3b008839.tar.gz
gsoc2013-evolution-a8705a44c50e1303157b769c59d8a86d3b008839.tar.zst
gsoc2013-evolution-a8705a44c50e1303157b769c59d8a86d3b008839.zip
** See bug #53159.
2004-01-21 Not Zed <NotZed@Ximian.com> ** See bug #53159. * em-format.c (emf_message_rfc822): removed incorrect comment, this is not a fallback. * em-format-html.c (efh_text_plain): check the content-type of the containee object, not the holder. ** See bug #52979. * em-format-html.c: take out text/x-patch and put in text/* for a text/plain fallback handler instead. * em-format-html-display.c (efhd_find_handler): allow the bonobo handlers to override the builtin ones. svn path=/trunk/; revision=24341
-rw-r--r--mail/ChangeLog18
-rw-r--r--mail/em-format-html-display.c19
-rw-r--r--mail/em-format-html.c15
-rw-r--r--mail/em-format.c1
4 files changed, 36 insertions, 17 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index c005e24e63..d7b8a34fba 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,21 @@
+2004-01-21 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #53159.
+
+ * em-format.c (emf_message_rfc822): removed incorrect comment,
+ this is not a fallback.
+
+ * em-format-html.c (efh_text_plain): check the content-type of the
+ containee object, not the holder.
+
+ ** See bug #52979.
+
+ * em-format-html.c: take out text/x-patch and put in text/* for a
+ text/plain fallback handler instead.
+
+ * em-format-html-display.c (efhd_find_handler): allow the bonobo
+ handlers to override the builtin ones.
+
2004-01-20 Jeffrey Stedfast <fejj@ximian.com>
* em-migrate.c (em_migrate_imap_caches_1_4): New function to
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 4f98729ab5..d904bf33a6 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -994,17 +994,18 @@ static const EMFormatHandler *efhd_find_handler(EMFormat *emf, const char *mime_
{
const EMFormatHandler *handle;
- handle = ((EMFormatClass *)efhd_parent)->find_handler(emf, mime_type);
- if (handle == NULL
- && efhd_use_component(mime_type)
- && (handle = g_hash_table_lookup(efhd_bonobo_handlers, mime_type)) == NULL) {
- EMFormatHandler *h = g_malloc0(sizeof(*h));
+ if (efhd_use_component(mime_type)) {
+ if ((handle = g_hash_table_lookup(efhd_bonobo_handlers, mime_type)) == NULL) {
+ EMFormatHandler *h = g_malloc0(sizeof(*h));
- h->mime_type = g_strdup(mime_type);
- h->handler = efhd_bonobo_unknown;
- g_hash_table_insert(efhd_bonobo_handlers, h->mime_type, h);
+ h->mime_type = g_strdup(mime_type);
+ h->handler = efhd_bonobo_unknown;
+ g_hash_table_insert(efhd_bonobo_handlers, h->mime_type, h);
- handle = h;
+ handle = h;
+ }
+ } else {
+ handle = ((EMFormatClass *)efhd_parent)->find_handler(emf, mime_type);
}
return handle;
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index a0346b00b0..441dc854e8 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -664,6 +664,7 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo
CamelStreamFilter *filtered_stream;
CamelMimeFilter *html_filter;
CamelMultipart *mp;
+ CamelDataWrapper *dw;
CamelContentType *type;
const char *format;
guint32 rgb = 0x737373, flags;
@@ -677,10 +678,11 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo
flags = efh->text_html_flags;
+ dw = camel_medium_get_content_object((CamelMedium *)part);
+
/* Check for RFC 2646 flowed text. */
- type = camel_mime_part_get_content_type(part);
- if (camel_content_type_is (type, "text", "plain")
- && (format = camel_content_type_param (type, "format"))
+ if (camel_content_type_is(dw->mime_type, "text", "plain")
+ && (format = camel_content_type_param(dw->mime_type, "format"))
&& !g_ascii_strcasecmp(format, "flowed"))
flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED;
@@ -703,9 +705,9 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo
null = camel_stream_null_new();
filtered_stream = camel_stream_filter_new_with_stream(null);
camel_object_unref(null);
- inline_filter = em_inline_filter_new(camel_mime_part_get_encoding(part), ((CamelDataWrapper *)part)->mime_type);
+ inline_filter = em_inline_filter_new(camel_mime_part_get_encoding(part), dw->mime_type);
camel_stream_filter_add(filtered_stream, (CamelMimeFilter *)inline_filter);
- camel_data_wrapper_write_to_stream(camel_medium_get_content_object((CamelMedium *)part), (CamelStream *)filtered_stream);
+ camel_data_wrapper_write_to_stream(dw, (CamelStream *)filtered_stream);
camel_stream_close((CamelStream *)filtered_stream);
camel_object_unref(filtered_stream);
mp = em_inline_filter_get_multipart(inline_filter);
@@ -1132,10 +1134,9 @@ static EMFormatHandler type_builtin_table[] = {
{ "image/x-xpixmap", (EMFormatFunc)efh_image },
{ "text/enriched", (EMFormatFunc)efh_text_enriched },
{ "text/plain", (EMFormatFunc)efh_text_plain },
- { "text/x-patch", (EMFormatFunc)efh_text_plain },
{ "text/html", (EMFormatFunc)efh_text_html },
{ "text/richtext", (EMFormatFunc)efh_text_enriched },
- /*{ "text/ *", (EMFormatFunc)efh_text_plain },*/
+ { "text/*", (EMFormatFunc)efh_text_plain },
{ "message/external-body", (EMFormatFunc)efh_message_external },
{ "multipart/signed", (EMFormatFunc)efh_multipart_signed },
{ "multipart/related", (EMFormatFunc)efh_multipart_related },
diff --git a/mail/em-format.c b/mail/em-format.c
index b1f597af8e..ef6678dfb3 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -1292,7 +1292,6 @@ emf_multipart_signed(EMFormat *emf, CamelStream *stream, CamelMimePart *part, co
camel_cipher_validity_free(valid);
}
-/* this is only a fallback, any implementer should implement */
static void
emf_message_rfc822(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
{