diff options
author | Not Zed <NotZed@Ximian.com> | 2004-09-24 12:09:10 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-09-24 12:09:10 +0800 |
commit | 6ce4413006e2ebd82c9e03d90bfa707c2ed371ee (patch) | |
tree | a88e8c57b21cf5469b1b610b1a670d73d989d02b /mail/em-format-html.c | |
parent | 71dab312c14e17ea8c9125b56a82db016fff527c (diff) | |
download | gsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.tar.gz gsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.tar.zst gsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.zip |
** See bug #65058 (again again).
2004-09-23 Not Zed <NotZed@Ximian.com>
** See bug #65058 (again again).
* em-format-html.c (efh_text_html): calculate our location uri
ourselves (content id).
* em-format.c (em_format_add_puri): if we have no content-location
key, don't fallback to any container's location.
svn path=/trunk/; revision=27356
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r-- | mail/em-format-html.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 7c362c5f4c..503a3053e2 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -795,8 +795,9 @@ efh_write_text_html(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri) static void efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) { - const char *location, *base; + const char *location, *base, *tmp; EMFormatPURI *puri; + char *cid = NULL; camel_stream_printf (stream, "<table bgcolor=\"#%06x\" cellspacing=0 cellpadding=1 width=100%%><tr><td>\n" @@ -821,14 +822,36 @@ efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFor gtk_html_set_base(efh->html, base); } - puri = em_format_add_puri((EMFormat *)efh, sizeof(EMFormatPURI), NULL, part, efh_write_text_html); - location = puri->uri?puri->uri:puri->cid; - d(printf("adding iframe, location %s\n", location)); + /* calculate our own location string so add_puri doesn't do it + for us. our iframes are special cases, we need to use the + proper base url to access them, but other children parts + shouldn't blindly inherit the container's location. */ + tmp = camel_mime_part_get_content_location(part); + if (tmp == NULL) { + if (((EMFormat *)efh)->base) + cid = camel_url_to_string(((EMFormat *)efh)->base, 0); + else + cid = g_strdup(((EMFormat *)efh)->part_id->str); + } else { + if (strchr(tmp, ':') == NULL && ((EMFormat *)efh)->base != NULL) { + CamelURL *uri; + + uri = camel_url_new_with_base(((EMFormat *)efh)->base, tmp); + cid = camel_url_to_string(uri, 0); + camel_url_free(uri); + } else { + cid = g_strdup(tmp); + } + } + + puri = em_format_add_puri((EMFormat *)efh, sizeof(EMFormatPURI), cid, part, efh_write_text_html); + d(printf("adding iframe, location %s\n", cid)); camel_stream_printf(stream, "<iframe src=\"%s\" frameborder=0 scrolling=no>could not get %s</iframe>\n" "</td></tr></table>\n" "</td></tr></table>\n", - location, location); + cid, cid); + g_free(cid); } /* This is a lot of code for something useless ... */ |