mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 11:11:04 +01:00
closes #3779
This commit is contained in:
@@ -26,13 +26,13 @@ var async = require('async'),
|
||||
|
||||
var now = Date.now();
|
||||
|
||||
if(type === 'upvote' && !unvote) {
|
||||
if (type === 'upvote' && !unvote) {
|
||||
db.sortedSetAdd('uid:' + uid + ':upvote', now, pid);
|
||||
} else {
|
||||
db.sortedSetRemove('uid:' + uid + ':upvote', pid);
|
||||
}
|
||||
|
||||
if(type === 'upvote' || unvote) {
|
||||
if (type === 'upvote' || unvote) {
|
||||
db.sortedSetRemove('uid:' + uid + ':downvote', pid);
|
||||
} else {
|
||||
db.sortedSetAdd('uid:' + uid + ':downvote', now, pid);
|
||||
@@ -213,7 +213,7 @@ var async = require('async'),
|
||||
|
||||
if (voteStatus.upvoted && command === 'downvote' || voteStatus.downvoted && command === 'upvote') { // e.g. User *has* upvoted, and clicks downvote
|
||||
hook = command;
|
||||
} else if (voteStatus.upvoted || voteStatus.downvoted) { // e.g. User *has* upvotes, clicks upvote (so we "unvote")
|
||||
} else if (voteStatus.upvoted || voteStatus.downvoted) { // e.g. User *has* upvoted, clicks upvote (so we "unvote")
|
||||
hook = 'unvote';
|
||||
} else { // e.g. User *has not* voted, clicks upvote
|
||||
hook = command;
|
||||
|
||||
Reference in New Issue
Block a user