mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
closes #965
This commit is contained in:
@@ -38,8 +38,17 @@ var async = require('async'),
|
||||
return false;
|
||||
}
|
||||
|
||||
db[type === 'upvote' || !unvote ? 'sortedSetAdd' : 'sortedSetRemove']('uid:' + uid + ':upvote', postData.timestamp, pid);
|
||||
db[type === 'upvote' || unvote ? 'sortedSetRemove' : 'sortedSetAdd']('uid:' + uid + ':downvote', postData.timestamp, pid);
|
||||
if(type === 'upvote' || !unvote) {
|
||||
db.sortedSetAdd('uid: ' + uid + ':upvote', postData.timestamp, pid);
|
||||
} else {
|
||||
db.sortedSetRemove('uid: ' + uid + ':upvote', pid);
|
||||
}
|
||||
|
||||
if(type === 'upvote' || unvote) {
|
||||
db.sortedSetRemove('uid: ' + uid + ':downvote', pid);
|
||||
} else {
|
||||
db.sortedSetAdd('uid: ' + uid + ':downvote', postData.timestamp, pid);
|
||||
}
|
||||
|
||||
user[type === 'upvote' ? 'incrementUserFieldBy' : 'decrementUserFieldBy'](postData.uid, 'reputation', 1, function (err, newreputation) {
|
||||
db.sortedSetAdd('users:reputation', newreputation, postData.uid);
|
||||
|
||||
Reference in New Issue
Block a user