modifyUserData does not check for offline status.

v1.18.x
Timothy Fike 9 years ago committed by GitHub
parent c9c60ef8ed
commit 247db79d57

@ -50,6 +50,10 @@ module.exports = function(User) {
addField('uploadedpicture');
}
if (fields.indexOf('status') !== -1) {
addField('lastonline');
}
db.getObjectsFields(keys, fields, function(err, users) {
if (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;
}
if (user.hasOwnProperty('status') && parseInt(user.lastonline, 10)) {
user.status = User.getStatus(user);
}
for(var i=0; i<fieldsToRemove.length; ++i) {
user[fieldsToRemove[i]] = undefined;
}
@ -183,4 +191,4 @@ module.exports = function(User) {
});
};
};
};

Loading…
Cancel
Save