mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
closes #964
This commit is contained in:
@@ -189,14 +189,15 @@ var winston = require('winston'),
|
|||||||
var topic;
|
var topic;
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
topics.getTopicFields(tid, ['cid', 'lastposttime', 'deleted'], next);
|
topics.getTopicFields(tid, ['cid', 'lastposttime', 'pinned', 'deleted'], next);
|
||||||
},
|
},
|
||||||
function(topicData, next) {
|
function(topicData, next) {
|
||||||
topic = topicData;
|
topic = topicData;
|
||||||
db.sortedSetRemove('categories:' + topicData.cid + ':tid', tid, next);
|
db.sortedSetRemove('categories:' + topicData.cid + ':tid', tid, next);
|
||||||
},
|
},
|
||||||
function(result, 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) {
|
], function(err, result) {
|
||||||
if(err) {
|
if(err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user