Skip to content

Node.js based forum software built for the modern web

no need for a call to count replies

psychobunny575a3c7b9d0d
diff --git a/src/topics/posts.js b/src/topics/posts.js
index 7f936b9b0d..96b1992fc9 100644
--- a/src/topics/posts.js
+++ b/src/topics/posts.js
@@ -413,9 +413,6 @@ module.exports = function (Topics) {
posts.getPostField(replyPids[0], 'timestamp', function (err, timestamp) {
next(err, utils.toISOString(timestamp));
});
- },
- "count": function (next) {
- db.sortedSetCard('pid:' + pid + ':replies', next);
}
}, function (err, replies) {
if (replies.users.length > 5) {
@@ -423,6 +420,8 @@ module.exports = function (Topics) {
replies.hasMore = true;
}
+ replies.count = replyPids.length;
+
next(err, replies);
});
});