closes #2413, closes #2599

This commit is contained in:
barisusakli
2015-01-14 16:02:29 -05:00
parent 8f5bf1a7ed
commit cd99324286
3 changed files with 28 additions and 45 deletions

View File

@@ -22,12 +22,7 @@ categoriesController.recent = function(req, res, next) {
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
plugins.fireHook('filter:category.get', {category: data, uid: uid}, function(err, data) {
if (err) {
return next(err);
}
res.render('recent', data.category);
});
res.render('recent', data);
});
};
@@ -49,24 +44,22 @@ categoriesController.popular = function(req, res, next) {
}
}
topics.getPopular(term, uid, meta.config.topicsPerList, function(err, data) {
topics.getPopular(term, uid, meta.config.topicsPerList, function(err, topics) {
if (err) {
return next(err);
}
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
var data = {
topics: topics,
'feeds:disableRSS': parseInt(meta.config['feeds:disableRSS'], 10) === 1
};
plugins.fireHook('filter:category.get', {category: {topics: data}, uid: uid}, function(err, data) {
if (err) {
return next(err);
}
if (uid === 0) {
anonCache[term] = data.category;
lastUpdateTime = Date.now();
}
if (uid === 0) {
anonCache[term] = data;
lastUpdateTime = Date.now();
}
res.render('popular', data.category);
});
res.render('popular', data);
});
};
@@ -78,12 +71,7 @@ categoriesController.unread = function(req, res, next) {
return next(err);
}
plugins.fireHook('filter:category.get', {category: data, uid: uid}, function(err, data) {
if (err) {
return next(err);
}
res.render('unread', data.category);
});
res.render('unread', data);
});
};