aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-09-24 12:09:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-09-24 12:09:10 +0800
commit6ce4413006e2ebd82c9e03d90bfa707c2ed371ee (patch)
treea88e8c57b21cf5469b1b610b1a670d73d989d02b /mail
parent71dab312c14e17ea8c9125b56a82db016fff527c (diff)
downloadgsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.tar
gsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.tar.gz
gsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.tar.bz2
gsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.tar.lz
gsoc2013-evolution-6ce4413006e2ebd82c9e03d90bfa707c2ed371ee.tar.xz
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')
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/em-format-html.c33
-rw-r--r--mail/em-format.c3
3 files changed, 39 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index fd35b59830..4f371628a5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,15 @@
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.
+
+2004-09-23 Not Zed <NotZed@Ximian.com>
+
* em-folder-tree.c (emft_get_folder_info__desc): describe the
get-folder process. This also makes it cancellable.
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 ... */
diff --git a/mail/em-format.c b/mail/em-format.c
index 39b039e2b6..df5ca50e65 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -354,8 +354,7 @@ em_format_add_puri(EMFormat *emf, size_t size, const char *cid, CamelMimePart *p
tmp = camel_mime_part_get_content_location(part);
puri->uri = NULL;
if (tmp == NULL) {
- if (emf->base)
- puri->uri = camel_url_to_string(emf->base, 0);
+ /* no location, don't set a uri at all, html parts do this themselves */
} else {
if (strchr(tmp, ':') == NULL && emf->base != NULL) {
CamelURL *uri;