v1.18.x
barisusakli 9 years ago
parent 92fba4f396
commit e9c488d489

@ -17,14 +17,17 @@ usersController.getOnlineUsers = function(req, res, next) {
if (err) { if (err) {
return next(err); return next(err);
} }
var hiddenCount = 0;
if (!userData.isAdminOrGlobalMod) { if (!userData.isAdminOrGlobalMod) {
userData.users = userData.users.filter(function(user) { userData.users = userData.users.filter(function(user) {
if (user && user.status === 'offline') {
hiddenCount ++;
}
return user && user.status !== 'offline'; return user && user.status !== 'offline';
}); });
} }
userData.anonymousUserCount = require('../socket.io').getOnlineAnonCount(); userData.anonymousUserCount = require('../socket.io').getOnlineAnonCount() + hiddenCount;
render(req, res, userData, next); render(req, res, userData, next);
}); });

Loading…
Cancel
Save