summaryrefslogtreecommitdiff
path: root/sfeed.c
diff options
context:
space:
mode:
Diffstat (limited to 'sfeed.c')
-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;