fix status if it was never set before

v1.18.x
barisusakli 10 years ago
parent 5d79d2a75a
commit 5dbd4bcda9

@ -121,7 +121,7 @@ function getUserDataByUserSlug(userslug, callerUID, callback) {
userData.disableSignatures = meta.config.disableSignatures !== undefined && parseInt(meta.config.disableSignatures, 10) === 1;
userData['email:confirmed'] = !!parseInt(userData['email:confirmed'], 10);
userData.profile_links = results.profile_links;
userData.status = !websockets.isUserOnline(userData.uid) ? 'offline' : userData.status;
userData.status = websockets.isUserOnline(userData.uid) ? (userData.status || 'online') : 'offline';
userData.banned = parseInt(userData.banned, 10) === 1;
userData.websiteName = userData.website.replace('http://', '').replace('https://', '');

@ -191,7 +191,7 @@ var async = require('async'),
var userData = results.userData;
for(var i=0; i<userData.length; ++i) {
userData[i].groups = results.groups[i];
userData[i].status = !results.online[i] ? 'offline' : userData[i].status;
userData[i].status = results.online[i] ? (userData[i].status || 'online') : 'offline';
}
async.map(userData, function(userData, next) {

Loading…
Cancel
Save