mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
clean up of posts and some template additions
This commit is contained in:
12
src/feed.js
12
src/feed.js
@@ -29,7 +29,9 @@
|
||||
|
||||
Feed.updateTopic = function (tid, callback) {
|
||||
topics.getTopicWithPosts(tid, 0, 0, -1, function (err, topicData) {
|
||||
if (err) return callback(new Error('topic-invalid'));
|
||||
if (err) {
|
||||
return callback(new Error('topic-invalid'));
|
||||
}
|
||||
|
||||
var feed = new rss({
|
||||
title: topicData.topic_name,
|
||||
@@ -44,7 +46,9 @@
|
||||
dateStamp;
|
||||
|
||||
// Add pubDate if topic contains posts
|
||||
if (topicData.posts.length > 0) feed.pubDate = new Date(parseInt(topicData.posts[0].timestamp, 10)).toUTCString();
|
||||
if (topicData.posts.length > 0) {
|
||||
feed.pubDate = new Date(parseInt(topicData.posts[0].timestamp, 10)).toUTCString();
|
||||
}
|
||||
|
||||
async.each(topic_posts, function(postData, next) {
|
||||
if (postData.deleted === '0') {
|
||||
@@ -65,7 +69,9 @@
|
||||
winston.info('[rss] Re-generated RSS Feed for tid ' + tid + '.');
|
||||
}
|
||||
|
||||
if (callback) callback();
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user