mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
limit topic views by session
This commit is contained in:
@@ -266,7 +266,11 @@ topicsController.get = function(req, res, callback) {
|
||||
res.locals.linkTags.push(rel);
|
||||
});
|
||||
|
||||
topics.increaseViewCount(tid);
|
||||
req.session.tids_viewed = req.session.tids_viewed || {};
|
||||
if (!req.session.tids_viewed[tid] || req.session.tids_viewed[tid] < Date.now() - 3600000) {
|
||||
topics.increaseViewCount(tid);
|
||||
req.session.tids_viewed[tid] = Date.now();
|
||||
}
|
||||
|
||||
if (req.uid) {
|
||||
topics.markAsRead([tid], req.uid, function(err, markedRead) {
|
||||
|
||||
Reference in New Issue
Block a user