[evolution-patches] 65058, wrong mime part displayed




hmm, this is definitely right for the image parts, for the text part, which is what this bug is about, it will work, but it might break pages that include relative links to the base url.  or it might not since that might be handled separately to just the iframe src attribute, i'm not sure.

--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3449
diff -u -3 -r1.3449 ChangeLog
--- mail/ChangeLog	2 Sep 2004 20:10:01 -0000	1.3449
+++ mail/ChangeLog	3 Sep 2004 01:12:24 -0000
@@ -1,3 +1,12 @@
+2004-09-03  Not Zed  <NotZed Ximian com>
+
+	** See bug #65058.
+
+	* em-format-html.c (efh_text_html): use the content-id rather than
+	the uri for tracking our internal frame reference.  Makes more
+	sense anyway, its guaranteed unique.
+	(efh_image): same here.
+
 2004-09-01  Jeffrey Stedfast  <fejj novell com>
 
 	Fix for bug #63377 and prevention of similar cases.
Index: mail/em-format-html-display.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-format-html-display.c,v
retrieving revision 1.50
diff -u -3 -r1.50 em-format-html-display.c
--- mail/em-format-html-display.c	23 Aug 2004 15:27:10 -0000	1.50
+++ mail/em-format-html-display.c	3 Sep 2004 01:12:25 -0000
@@ -959,7 +959,7 @@
 	CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)puri->part);
 
 	/* TODO: identical to efh_write_image */
-	d(printf("writing image '%s'\n", puri->uri?puri->uri:puri->cid));
+	d(printf("writing image '%s'\n", puri->cid));
 	camel_data_wrapper_decode_to_stream(dw, stream);
 	camel_stream_close(stream);
 }
Index: mail/em-format-html.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-format-html.c,v
retrieving revision 1.63
diff -u -3 -r1.63 em-format-html.c
--- mail/em-format-html.c	12 Aug 2004 16:34:22 -0000	1.63
+++ mail/em-format-html.c	3 Sep 2004 01:12:26 -0000
@@ -797,7 +797,7 @@
 static void
 efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info)
 {
-	const char *location, *base;
+	const char *base;
 	EMFormatPURI *puri;
 
 	camel_stream_printf (stream,
@@ -824,13 +824,12 @@
 	}
 
 	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));
+	d(printf("adding iframe, location %s\n", puri->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);
+			    puri->cid, puri->cid);
 }
 
 /* This is a lot of code for something useless ... */
@@ -1087,7 +1086,7 @@
 {
 	CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)puri->part);
 
-	d(printf("writing image '%s'\n", puri->uri?puri->uri:puri->cid));
+	d(printf("writing image '%s'\n", puri->cid));
 	camel_data_wrapper_decode_to_stream(dw, stream);
 	camel_stream_close(stream);
 }
@@ -1096,12 +1095,10 @@
 efh_image(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info)
 {
 	EMFormatPURI *puri;
-	const char *location;
 
 	puri = em_format_add_puri((EMFormat *)efh, sizeof(EMFormatPURI), NULL, part, efh_write_image);
-	location = puri->uri?puri->uri:puri->cid;
-	d(printf("adding image '%s'\n", location));
-	camel_stream_printf(stream, "<img hspace=10 vspace=10 src=\"%s\">", location);
+	d(printf("adding image '%s'\n", puri->cid));
+	camel_stream_printf(stream, "<img hspace=10 vspace=10 src=\"%s\">", puri->cid);
 }
 
 static EMFormatHandler type_builtin_table[] = {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]