diff --git a/src/user/follow.js b/src/user/follow.js index 4c4dfc5223..c3e2cb340c 100644 --- a/src/user/follow.js +++ b/src/user/follow.js @@ -23,16 +23,14 @@ module.exports = function(User) { return callback(new Error('[[error:you-cant-follow-yourself]]')); } - var now = Date.now(); - if (type === 'follow') { + var now = Date.now(); async.parallel([ async.apply(db.sortedSetAdd, 'following:' + uid, now, theiruid), async.apply(db.sortedSetAdd, 'followers:' + theiruid, now, uid), async.apply(User.incrementUserFieldBy, uid, 'followingCount', 1), async.apply(User.incrementUserFieldBy, theiruid, 'followerCount', 1) ], callback); - } else { async.parallel([ async.apply(db.sortedSetRemove, 'following:' + uid, theiruid), diff --git a/src/user/notifications.js b/src/user/notifications.js index 6e65d37649..ccadf4f999 100644 --- a/src/user/notifications.js +++ b/src/user/notifications.js @@ -7,7 +7,6 @@ var async = require('async'), S = require('string'), user = require('../user'), - utils = require('../../public/src/utils'), db = require('../database'), meta = require('../meta'), notifications = require('../notifications'),