mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-15 21:20:29 +02:00
closes #2584
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user