fix ipMatch data

v1.18.x
Baris Usakli 8 years ago
parent ae3d5f8aaa
commit 541b78c26d

@ -178,7 +178,7 @@ module.exports = function (User) {
async.parallel([ async.parallel([
function (next) { function (next) {
getIPMatchedUsers(user.ip, next); getIPMatchedUsers(user, next);
}, },
function (next) { function (next) {
getSpamData(user, next); getSpamData(user, next);
@ -197,14 +197,18 @@ module.exports = function (User) {
], callback); ], callback);
}; };
function getIPMatchedUsers(ip, callback) { function getIPMatchedUsers(user, callback) {
async.waterfall([ async.waterfall([
function (next) { function (next) {
User.getUidsFromSet('ip:' + ip + ':uid', 0, -1, next); User.getUidsFromSet('ip:' + user.ip + ':uid', 0, -1, next);
}, },
function (uids, next) { function (uids, next) {
User.getUsersFields(uids, ['uid', 'username', 'picture'], next); User.getUsersFields(uids, ['uid', 'username', 'picture'], next);
}, },
function (data, next) {
user.ipMatch = data;
next();
}
], callback); ], callback);
} }

Loading…
Cancel
Save