|
|
@ -50,6 +50,10 @@ module.exports = function(User) {
|
|
|
|
addField('uploadedpicture');
|
|
|
|
addField('uploadedpicture');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fields.indexOf('status') !== -1) {
|
|
|
|
|
|
|
|
addField('lastonline');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
db.getObjectsFields(keys, fields, function(err, users) {
|
|
|
|
db.getObjectsFields(keys, fields, function(err, users) {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
return callback(err);
|
|
|
|
return callback(err);
|
|
|
@ -117,6 +121,10 @@ module.exports = function(User) {
|
|
|
|
user.uploadedpicture = user.uploadedpicture.startsWith('http') ? user.uploadedpicture : nconf.get('relative_path') + user.uploadedpicture;
|
|
|
|
user.uploadedpicture = user.uploadedpicture.startsWith('http') ? user.uploadedpicture : nconf.get('relative_path') + user.uploadedpicture;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (user.hasOwnProperty('status') && parseInt(user.lastonline, 10)) {
|
|
|
|
|
|
|
|
user.status = User.getStatus(user);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for(var i=0; i<fieldsToRemove.length; ++i) {
|
|
|
|
for(var i=0; i<fieldsToRemove.length; ++i) {
|
|
|
|
user[fieldsToRemove[i]] = undefined;
|
|
|
|
user[fieldsToRemove[i]] = undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -183,4 +191,4 @@ module.exports = function(User) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|