From 9b147edb369c37a94e9f6aab89cedcfb729fdca8 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Fri, 7 Feb 2014 12:27:55 -0500 Subject: [PATCH] closes #964 --- src/threadTools.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/threadTools.js b/src/threadTools.js index 5125eaf6a4..fa34bef729 100644 --- a/src/threadTools.js +++ b/src/threadTools.js @@ -189,14 +189,15 @@ var winston = require('winston'), var topic; async.waterfall([ function(next) { - topics.getTopicFields(tid, ['cid', 'lastposttime', 'deleted'], next); + topics.getTopicFields(tid, ['cid', 'lastposttime', 'pinned', 'deleted'], next); }, function(topicData, next) { topic = topicData; db.sortedSetRemove('categories:' + topicData.cid + ':tid', tid, next); }, function(result, next) { - db.sortedSetAdd('categories:' + cid + ':tid', topic.lastposttime, tid, next); + var timestamp = parseInt(topic.pinned, 10) ? Math.pow(2, 53) : topic.lastposttime; + db.sortedSetAdd('categories:' + cid + ':tid', timestamp, tid, next); } ], function(err, result) { if(err) {