v1.18.x
Baris Soner Usakli 11 years ago
parent d6780652ad
commit 9b147edb36

@ -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) {

Loading…
Cancel
Save