diff options
author | Milan Crha <mcrha@redhat.com> | 2012-04-24 16:40:22 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-04-24 16:40:22 +0800 |
commit | c40339cf1db1244e6aada0267e4a36ac8691a106 (patch) | |
tree | 5a4f874c64a1307f1e3068c98e3e81250df25fc1 | |
parent | 100111d5914d07abfc41706a640da2d471a47999 (diff) | |
download | gsoc2013-evolution-c40339cf1db1244e6aada0267e4a36ac8691a106.tar.gz gsoc2013-evolution-c40339cf1db1244e6aada0267e4a36ac8691a106.tar.zst gsoc2013-evolution-c40339cf1db1244e6aada0267e4a36ac8691a106.zip |
Attached images not shown in text/html within multipart/mixed
This should work like multipart/related, but if a mailer sends
multipart/mixed with text/html and image/* parts, where the html
part looks for the image (with cid:...) then these were not found
and html part showed image as missing.
-rw-r--r-- | mail/em-format-html.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 3c130e63d4..6c4c2d7387 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1703,6 +1703,12 @@ badurl: /* ********************************************************************** */ static void +emfh_write_related (EMFormat *emf, + CamelStream *stream, + EMFormatPURI *puri, + GCancellable *cancellable); + +static void efh_url_requested (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, @@ -1714,6 +1720,26 @@ efh_url_requested (GtkHTML *html, d(printf("url requested, html = %p, url '%s'\n", html, url)); puri = em_format_find_visible_puri ((EMFormat *) efh, url); + if (!puri && url && g_str_has_prefix (url, "cid:")) { + GHashTableIter iter; + gpointer key, value; + + g_hash_table_iter_init (&iter, ((EMFormat *) efh)->pending_uri_table); + while (g_hash_table_iter_next (&iter, &key, &value)) { + puri = value; + + if (puri->part && g_strcmp0 (url + 4, camel_mime_part_get_content_id (puri->part)) == 0) + break; + + puri = NULL; + } + + if (puri) { + /* it's expected as cid:, with its content, thus write it as such */ + puri->func = emfh_write_related; + } + } + if (puri) { CamelDataWrapper *dw = camel_medium_get_content ((CamelMedium *) puri->part); CamelContentType *ct = dw ? dw->mime_type : NULL; |