This commit is contained in:
barisusakli
2014-11-07 17:15:01 -05:00
parent d77bd638c4
commit 1ae39d638a
10 changed files with 101 additions and 28 deletions

View File

@@ -163,7 +163,7 @@ var winston = require('winston'),
topics.setTopicField(tid, 'pinned', pin ? 1 : 0);
topics.getTopicFields(tid, ['cid', 'lastposttime'], function(err, topicData) {
db.sortedSetAdd('categories:' + topicData.cid + ':tid', pin ? Math.pow(2, 53) : topicData.lastposttime, tid);
db.sortedSetAdd('cid:' + topicData.cid + ':tids', pin ? Math.pow(2, 53) : topicData.lastposttime, tid);
});
plugins.fireHook('action:topic.pin', {
@@ -192,11 +192,11 @@ var winston = require('winston'),
},
function(topicData, next) {
topic = topicData;
db.sortedSetRemove('categories:' + topicData.cid + ':tid', tid, next);
db.sortedSetRemove('cid:' + topicData.cid + ':tids', tid, next);
},
function(next) {
var timestamp = parseInt(topic.pinned, 10) ? Math.pow(2, 53) : topic.lastposttime;
db.sortedSetAdd('categories:' + cid + ':tid', timestamp, tid, next);
db.sortedSetAdd('cid:' + cid + ':tids', timestamp, tid, next);
}
], function(err) {
if (err) {