mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
deleting and restoring posts and topics now update the corresponding RSS feeds
fixed #257
This commit is contained in:
22
src/feed.js
22
src/feed.js
@@ -46,17 +46,19 @@
|
||||
if (topicData.main_posts.length > 0) feed.pubDate = new Date(parseInt(topicData.main_posts[0].timestamp, 10)).toUTCString();
|
||||
|
||||
for (var i = 0, ii = topic_posts.length; i < ii; i++) {
|
||||
postData = topic_posts[i];
|
||||
dateStamp = new Date(parseInt(postData.edited === '0' ? postData.timestamp : postData.edited, 10)).toUTCString();
|
||||
title = 'Reply to ' + topicData.topic_name + ' on ' + dateStamp;
|
||||
if (topic_posts[i].deleted === '0') {
|
||||
postData = topic_posts[i];
|
||||
dateStamp = new Date(parseInt(postData.edited === '0' ? postData.timestamp : postData.edited, 10)).toUTCString();
|
||||
title = 'Reply to ' + topicData.topic_name + ' on ' + dateStamp;
|
||||
|
||||
feed.item({
|
||||
title: title,
|
||||
description: postData.content,
|
||||
url: nconf.get('url') + 'topic/' + topicData.slug + '#' + postData.pid,
|
||||
author: postData.username,
|
||||
date: dateStamp
|
||||
});
|
||||
feed.item({
|
||||
title: title,
|
||||
description: postData.content,
|
||||
url: nconf.get('url') + 'topic/' + topicData.slug + '#' + postData.pid,
|
||||
author: postData.username,
|
||||
date: dateStamp
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Feed.saveFeed('feeds/topics/' + tid + '.rss', feed, function(err) {
|
||||
|
||||
Reference in New Issue
Block a user