From e9c488d4891f81d8adeb333a6c49f64cb9622e65 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 24 Feb 2016 13:09:53 +0200 Subject: [PATCH] closes #4166 --- src/controllers/users.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controllers/users.js b/src/controllers/users.js index 4fae38907c..b014ac3452 100644 --- a/src/controllers/users.js +++ b/src/controllers/users.js @@ -17,14 +17,17 @@ usersController.getOnlineUsers = function(req, res, next) { if (err) { return next(err); } - + var hiddenCount = 0; if (!userData.isAdminOrGlobalMod) { userData.users = userData.users.filter(function(user) { + if (user && user.status === 'offline') { + hiddenCount ++; + } return user && user.status !== 'offline'; }); } - userData.anonymousUserCount = require('../socket.io').getOnlineAnonCount(); + userData.anonymousUserCount = require('../socket.io').getOnlineAnonCount() + hiddenCount; render(req, res, userData, next); });