mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
faster getReplies
This commit is contained in:
22
src/user.js
22
src/user.js
@@ -78,12 +78,24 @@ User.getUsersWithFields = function (uids, fields, uid, callback) {
|
||||
function (results, next) {
|
||||
results.userData.forEach(function (user, index) {
|
||||
if (user) {
|
||||
user.status = User.getStatus(user);
|
||||
user.administrator = results.isAdmin[index];
|
||||
user.banned = parseInt(user.banned, 10) === 1;
|
||||
user.banned_until = parseInt(user['banned:expire'], 10) || 0;
|
||||
user.banned_until_readable = user.banned_until ? new Date(user.banned_until).toString() : 'Not Banned';
|
||||
user['email:confirmed'] = parseInt(user['email:confirmed'], 10) === 1;
|
||||
|
||||
if (user.hasOwnProperty('status')) {
|
||||
user.status = User.getStatus(user);
|
||||
}
|
||||
|
||||
if (user.hasOwnProperty('banned')) {
|
||||
user.banned = parseInt(user.banned, 10) === 1;
|
||||
}
|
||||
|
||||
if (user.hasOwnProperty('banned:expire')) {
|
||||
user.banned_until = parseInt(user['banned:expire'], 10) || 0;
|
||||
user.banned_until_readable = user.banned_until ? new Date(user.banned_until).toString() : 'Not Banned';
|
||||
}
|
||||
|
||||
if (user.hasOwnProperty(['email:confirmed'])) {
|
||||
user['email:confirmed'] = parseInt(user['email:confirmed'], 10) === 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
plugins.fireHook('filter:userlist.get', { users: results.userData, uid: uid }, next);
|
||||
|
||||
Reference in New Issue
Block a user