diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-01-05 15:19:26 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-01-05 15:19:26 +0100 |
commit | 3d53648620178dc30ec8d8b459f786344082b1aa (patch) | |
tree | 3e6535b8431ecc651fd944a3eb3aabc90e4d250e | |
parent | b50c0f5b36e9b88367bacb6ca44f4791b8f7eebc (diff) |
sfeed: prefer updated timestamp over published for Atom
-rw-r--r-- | sfeed.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; |