From 30cfddda685a9b50497928451f77486e302b2875 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sun, 9 Mar 2014 23:20:59 -0400 Subject: [PATCH] fix for topics view count, and marking topics as unread --- src/controllers/topics.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/controllers/topics.js b/src/controllers/topics.js index f71e751627..4063d58f2e 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -159,6 +159,15 @@ topicsController.get = function(req, res, next) { topic_url += '?' + queryString; } + + if (uid) { + topics.markAsRead(tid, uid, function(err) { + topics.pushUnreadCount(uid); + }); + } + + topics.increaseViewCount(tid); + // Paginator for noscript data.pages = []; for(var x=1;x<=data.pageCount;x++) {