From a9fbd5be8adb26e9fc601ff3586ec5db99d7846f Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 6 Feb 2014 16:55:41 -0500 Subject: [PATCH] derp, upgrade was upvoting your own favourited posts as well --- src/upgrade.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/upgrade.js b/src/upgrade.js index 0560bfd032..5f7140d31d 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -491,9 +491,11 @@ Upgrade.upgrade = function(callback) { var pid = post.pid, uid = user.uid; - db.setAdd('pid:' + pid + ':upvote', uid); - db.sortedSetAdd('uid:' + uid + ':upvote', post.timestamp, pid); - db.incrObjectField('post:' + pid, 'votes'); + if (post.uid !== uid) { + db.setAdd('pid:' + pid + ':upvote', uid); + db.sortedSetAdd('uid:' + uid + ':upvote', post.timestamp, pid); + db.incrObjectField('post:' + pid, 'votes'); + } next(); }