If there is no pubdate in an rss or atom feed item, use the current date/time
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 Apr 2011 16:21:56 +0000 (12:21 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 Apr 2011 16:21:56 +0000 (12:21 -0400)
citadel/modules/rssclient/serv_rssclient.c

index dd662ed085c2a7bb9fc02de17bed59f8249755a0..98f23e6ee4673d3fbb9456f3b02726fe4c575cd1 100644 (file)
@@ -673,8 +673,13 @@ void rss_save_item(rss_item *ri)
                        msg->cm_fields['U'] = SmashStrBuf(&QPEncoded);
                        FreeStrBuf(&Encoded);
                }
+
+               if (ri->pubdate <= 0) {
+                       ri->pubdate = time(NULL);
+               }
                msg->cm_fields['T'] = malloc(64);
                snprintf(msg->cm_fields['T'], 64, "%ld", ri->pubdate);
+
                if (ri->channel_title != NULL) {
                        if (StrLength(ri->channel_title) > 0) {
                                msg->cm_fields['O'] = strdup(ChrPtr(ri->channel_title));