summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-01-05 15:19:26 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-01-05 15:19:26 +0100
commit3d53648620178dc30ec8d8b459f786344082b1aa (patch)
tree3e6535b8431ecc651fd944a3eb3aabc90e4d250e
parentb50c0f5b36e9b88367bacb6ca44f4791b8f7eebc (diff)
sfeed: prefer updated timestamp over published for Atom
-rw-r--r--sfeed.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sfeed.c b/sfeed.c
index d27f851..3d5e1a3 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -641,12 +641,16 @@ xml_handler_start_element(XMLParser *p, const char *name, size_t namelen)
string_clear(ctx.field);
} else if(ctx.item.feedtype == FeedTypeAtom) {
if(ctx.tagid == AtomTagPublished || ctx.tagid == AtomTagUpdated) {
- ctx.field = &ctx.item.timestamp;
+ /* ignore, prefer updated over published */
+ if(ctx.tagid != AtomTagPublished || !ctx.item.timestamp.len) {
+ ctx.field = &ctx.item.timestamp;
+ return;
+ }
} else if(ctx.tagid == AtomTagTitle) {
ctx.field = &ctx.item.title;
} else if(ctx.tagid == AtomTagSummary || ctx.tagid == AtomTagContent) {
/* ignore, prefer content:encoded over description */
- if(!(ctx.tagid == AtomTagSummary && ctx.item.content.len)) {
+ if(ctx.tagid != AtomTagSummary || !ctx.item.content.len) {
ctx.iscontenttag = 1;
ctx.field = &ctx.item.content;
return;