diff --git a/mozilla/mail/extensions/newsblog/content/FeedItem.js b/mozilla/mail/extensions/newsblog/content/FeedItem.js index d799550f303..059e122b2f6 100755 --- a/mozilla/mail/extensions/newsblog/content/FeedItem.js +++ b/mozilla/mail/extensions/newsblog/content/FeedItem.js @@ -196,7 +196,7 @@ FeedItem.prototype = this.content = content; // XXX store it elsewhere, f.e. this.page this.writeToFolder(); } - else if (this.feed.quickMode) + else if (this.feed.quickMode || !this.mURL) { debug(this.identity + " in quick mode; storing"); @@ -256,7 +256,7 @@ FeedItem.prototype = // Backward compatibility: we might have stored this item before isStoredWithId // has been turned on for RSS 2.0 (bug 354345). Check whether this item has been // stored with its URL. - if (!downloaded && itemURI != this.mURL) + if (!downloaded && this.mURL && itemURI != this.mURL) { itemResource = rdf.GetResource(this.mURL); downloaded = ds.GetTarget(itemResource, FZ_STORED, true); @@ -302,7 +302,7 @@ FeedItem.prototype = // Backward compatibility: we might have stored this item before isStoredWithId // has been turned on for RSS 2.0 (bug 354345). Check whether this item has been // stored with its URL. - if (!ds.GetTarget(resource, FZ_STORED, true) && itemURI != this.mURL) + if (!ds.GetTarget(resource, FZ_STORED, true) && this.mURL && itemURI != this.mURL) resource = rdf.GetResource(this.mURL); if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true)) diff --git a/mozilla/mail/extensions/newsblog/content/feed-parser.js b/mozilla/mail/extensions/newsblog/content/feed-parser.js index 675de2cff2f..68522364c74 100644 --- a/mozilla/mail/extensions/newsblog/content/feed-parser.js +++ b/mozilla/mail/extensions/newsblog/content/feed-parser.js @@ -134,11 +134,11 @@ FeedParser.prototype = { guid = getNodeValue(guidNode); isPermaLink = guidNode.getAttribute('isPermaLink') == 'false' ? false : true; + item.id = guid; + item.isStoredWithId = true; } - item.isStoredWithId = true; item.url = link ? link : (guid && isPermaLink) ? guid : null; - item.id = guid; item.description = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "description")[0]); item.title = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "title")[0]) || (item.description ? (this.stripTags(item.description).substr(0, 150)) : null) @@ -151,7 +151,10 @@ FeedParser.prototype = item.date = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "pubDate")[0] || this.childrenByTagNameNS(itemNode, DC_NS, "date")[0]) || item.date; - + + if (!item.id) + item.id = item.feed.url + '#' + (item.date || item.title); + // If the date is invalid, users will see the beginning of the epoch // unless we reset it here, so they'll see the current time instead. // This is typical aggregator behavior.