mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix ipMatch data
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user