[evolution-rss] decode only feed comments images



commit a128635b427e7edc13dcd28c262a572478c14949
Author: Lucian Langa <lucilanga gnome org>
Date:   Wed May 26 19:48:19 2010 +0300

    decode only feed comments images

 src/parser.c |   14 ++++++++------
 src/parser.h |    2 +-
 src/rss.c    |    2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/parser.c b/src/parser.c
index 0d01ae2..76c7e7d 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -860,7 +860,7 @@ tree_walk (xmlNodePtr root, RDF *r)
 }
 
 gchar *
-process_images(gchar *text, gchar *link, EMFormatHTML *format)
+process_images(gchar *text, gchar *link, gboolean decode, EMFormatHTML *format)
 {
 	xmlChar *buff = NULL;
 	guint size = 0;
@@ -873,10 +873,12 @@ process_images(gchar *text, gchar *link, EMFormatHTML *format)
 			xmlChar *url = xmlGetProp(doc, (xmlChar *)"src");
 			if (url) {
 				if ((name = fetch_image_redraw((gchar *)url, link, format))) {
-					tname = decode_image_cache_filename(name);
-					g_free(name);
-					name = g_filename_to_uri (tname, NULL, NULL);
-					g_free(tname);
+					if (decode) {
+						tname = decode_image_cache_filename(name);
+						g_free(name);
+						name = g_filename_to_uri (tname, NULL, NULL);
+						g_free(tname);
+					}
 					xmlSetProp(
 						doc, (xmlChar *)"src",
 						(xmlChar *)name);
@@ -1055,7 +1057,7 @@ parse_channel_line(xmlNode *top, gchar *feed_name, char *main_date, gchar **arti
 		g_free(b);
 
 		if (feed_name) {
-			gchar *buff = process_images(tmp, link, NULL);
+			gchar *buff = process_images(tmp, link, FALSE, NULL);
 			g_free(tmp);
 			b = buff;
 		} else
diff --git a/src/parser.h b/src/parser.h
index 7048912..10401ff 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -57,7 +57,7 @@ gchar *media_rss(xmlNode *node, gchar *search, gchar *fail);
 gchar *dublin_core_rss(xmlNode *node, gchar *fail);
 void syndication_rss(void);
 gchar *wfw_rss(xmlNode *node, gchar *fail);
-gchar *process_images(gchar *text, gchar *link, EMFormatHTML *format);
+gchar *process_images(gchar *text, gchar *link, gboolean decode, EMFormatHTML *format);
 
 #endif /*__RSS_H__*/
 
diff --git a/src/rss.c b/src/rss.c
index ac3bfe6..48d9711 100644
--- a/src/rss.c
+++ b/src/rss.c
@@ -5600,7 +5600,7 @@ display_comments (RDF *r, EMFormatHTML *format)
 	xmlNodePtr root = xmlDocGetRootElement (r->cache);
 	if (tree_walk (root, r)) {
 		gchar *comments = update_comments(r);
-		tmp = process_images(comments, r->uri, format);
+		tmp = process_images(comments, r->uri, TRUE, format);
 		g_free(comments);
 		if (r->maindate)
 			g_free(r->maindate);



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