[Commits] feed.c 1.1.2.126 1.1.2.127 parsers.c 1.1.2.33 1.1.2.34

ticho at claws-mail.org ticho at claws-mail.org
Sun Sep 16 14:06:43 CEST 2012


Update of /home/claws-mail/plugins/rssyl/src
In directory srv:/tmp/cvs-serv21390/src

Modified Files:
      Tag: gtk2
	feed.c parsers.c 
Log Message:
2012-09-16 [ticho]	0.33.0cvs5

	* src/feed.c
	* src/parsers.c
		Fix storing&parsing of Atom feeds where entries have
		no link tag.

Index: feed.c
===================================================================
RCS file: /home/claws-mail/plugins/rssyl/src/Attic/feed.c,v
retrieving revision 1.1.2.126
retrieving revision 1.1.2.127
diff -u -d -r1.1.2.126 -r1.1.2.127
--- feed.c	2 Aug 2012 14:39:10 -0000	1.1.2.126
+++ feed.c	16 Sep 2012 12:06:40 -0000	1.1.2.127
@@ -736,8 +736,10 @@
 				/* ID */
 				if( !strcmp(line[0], "Message-ID") ) {
 					splid = g_strsplit_set(line[1], "<>", 3);
-					if( strlen(splid[1]) != 0 )
+					if( strlen(splid[1]) != 0 ) {
 						fitem->id = g_strdup(splid[1]);
+						debug_print("RSSyl: got id '%s'\n", fitem->id);
+					}
 					g_strfreev(splid);
 				}
 
@@ -1097,6 +1099,10 @@
 		/* if atleast one has some text, they differ */
 		if( old_item->text || new_item->text ) {
 			debug_print("RSSyl: +/- text\n");
+			if ( !old_item->text )
+				debug_print("RSSyl:   old_item has no text\n");
+			else
+				debug_print("RSSyl:   new_item has no text\n");
 			return ITEM_CHANGED_TEXTONLY;
 		}
 	}

Index: parsers.c
===================================================================
RCS file: /home/claws-mail/plugins/rssyl/src/Attic/parsers.c,v
retrieving revision 1.1.2.33
retrieving revision 1.1.2.34
diff -u -d -r1.1.2.33 -r1.1.2.34
--- parsers.c	21 Feb 2011 20:39:03 -0000	1.1.2.33
+++ parsers.c	16 Sep 2012 12:06:40 -0000	1.1.2.34
@@ -508,6 +508,19 @@
 		} while( (n = n->next) != NULL);
 
 		if( fitem->id && fitem->title && fitem->date ) {
+
+			/* If no link is available, and we can safely guess ID
+			 * might be a (perma)link, mark it so. */
+			if (!fitem->link && fitem->id	/* no url, but we have id */
+					&& (!strncmp(fitem->id, "http:", 5) /* id looks like an url */
+						|| !strncmp(fitem->id, "https:", 6))) {
+				if (!ritem->url || strcmp(ritem->url, fitem->id)) {
+					/* id is different from feed url (good chance it is a permalink) */
+					debug_print("RSSyl: Marking ID as permalink\n");
+					fitem->id_is_permalink = TRUE;
+				}
+			}
+
 			if (rssyl_add_feed_item(ritem, fitem) == FALSE) {
 				rssyl_free_feeditem(fitem);
 				fitem = NULL;



More information about the Commits mailing list