mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
fix: dont update cid:<cid>:tids:votes if topic is pinned
This commit is contained in:
@@ -157,7 +157,7 @@ Posts.updatePostVoteCount = function (postData, callback) {
|
|||||||
function (next) {
|
function (next) {
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
topics.getTopicFields(postData.tid, ['mainPid', 'cid'], next);
|
topics.getTopicFields(postData.tid, ['mainPid', 'cid', 'pinned'], next);
|
||||||
},
|
},
|
||||||
function (topicData, next) {
|
function (topicData, next) {
|
||||||
if (parseInt(topicData.mainPid, 10) === parseInt(postData.pid, 10)) {
|
if (parseInt(topicData.mainPid, 10) === parseInt(postData.pid, 10)) {
|
||||||
@@ -172,7 +172,11 @@ Posts.updatePostVoteCount = function (postData, callback) {
|
|||||||
db.sortedSetAdd('topics:votes', postData.votes, postData.tid, next);
|
db.sortedSetAdd('topics:votes', postData.votes, postData.tid, next);
|
||||||
},
|
},
|
||||||
function (next) {
|
function (next) {
|
||||||
db.sortedSetAdd('cid:' + topicData.cid + ':tids:votes', postData.votes, postData.tid, next);
|
if (!topicData.pinned) {
|
||||||
|
db.sortedSetAdd('cid:' + topicData.cid + ':tids:votes', postData.votes, postData.tid, next);
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
], function (err) {
|
], function (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user