mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-16 01:20:52 +01:00
more refactors
This commit is contained in:
@@ -38,7 +38,7 @@ module.exports = function(User) {
|
||||
var uids = users.map(function(user) {
|
||||
return user.score;
|
||||
});
|
||||
User.getMultipleUserFields(uids, ['uid', 'email', 'username'], next);
|
||||
User.getUsersFields(uids, ['uid', 'email', 'username'], next);
|
||||
},
|
||||
function(usersData, next) {
|
||||
usersData.forEach(function(user, index) {
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = function(User) {
|
||||
};
|
||||
|
||||
User.getUserFields = function(uid, fields, callback) {
|
||||
User.getMultipleUserFields([uid], fields, function(err, users) {
|
||||
User.getUsersFields([uid], fields, function(err, users) {
|
||||
callback(err, users ? users[0] : null);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -77,7 +77,7 @@ var async = require('async'),
|
||||
Digest.send = function(data, callback) {
|
||||
var now = new Date();
|
||||
|
||||
user.getMultipleUserFields(data.subscribers, ['uid', 'username', 'userslug', 'lastonline'], function(err, users) {
|
||||
user.getUsersFields(data.subscribers, ['uid', 'username', 'userslug', 'lastonline'], function(err, users) {
|
||||
if (err) {
|
||||
winston.error('[user/jobs] Could not send digests (' + data.interval + '): ' + err.message);
|
||||
return callback(err);
|
||||
|
||||
@@ -103,7 +103,7 @@ module.exports = function(User) {
|
||||
|
||||
async.parallel({
|
||||
userData: function(next) {
|
||||
User.getMultipleUserFields(uids, fields, next);
|
||||
User.getUsersFields(uids, fields, next);
|
||||
},
|
||||
isOnline: function(next) {
|
||||
if (data.onlineOnly) {
|
||||
|
||||
Reference in New Issue
Block a user