From 541b78c26de9fbd7dbb68a17c7b77cf2d301dc53 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Wed, 26 Jul 2017 13:39:34 -0400 Subject: [PATCH] fix ipMatch data --- src/user/approval.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/user/approval.js b/src/user/approval.js index d04686a7b0..766cca124b 100644 --- a/src/user/approval.js +++ b/src/user/approval.js @@ -178,7 +178,7 @@ module.exports = function (User) { async.parallel([ function (next) { - getIPMatchedUsers(user.ip, next); + getIPMatchedUsers(user, next); }, function (next) { getSpamData(user, next); @@ -197,14 +197,18 @@ module.exports = function (User) { ], callback); }; - function getIPMatchedUsers(ip, callback) { + function getIPMatchedUsers(user, callback) { async.waterfall([ function (next) { - User.getUidsFromSet('ip:' + ip + ':uid', 0, -1, next); + User.getUidsFromSet('ip:' + user.ip + ':uid', 0, -1, next); }, function (uids, next) { User.getUsersFields(uids, ['uid', 'username', 'picture'], next); }, + function (data, next) { + user.ipMatch = data; + next(); + } ], callback); }