This commit is contained in:
barisusakli
2016-08-05 22:35:26 +03:00
parent b07ae9a2ff
commit 84025fa7fc
2 changed files with 31 additions and 2 deletions

View File

@@ -228,7 +228,11 @@ var plugins = require('./plugins');
async.parallel([
function (next) {
if (postData.uid) {
db.sortedSetAdd('uid:' + postData.uid + ':posts:votes', postData.votes, postData.pid, next);
if (postData.votes > 0) {
db.sortedSetAdd('uid:' + postData.uid + ':posts:votes', postData.votes, postData.pid, next);
} else {
db.sortedSetRemove('uid:' + postData.uid + ':posts:votes', postData.pid, next);
}
} else {
next();
}