From 780838c57967dbb7ec18bf9f77f852643800339e Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 8 Jul 2015 18:46:58 -0400 Subject: [PATCH] fixes "other" category for presence graph --- src/socket.io/meta.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/socket.io/meta.js b/src/socket.io/meta.js index de20723f5e..018ecc64ce 100644 --- a/src/socket.io/meta.js +++ b/src/socket.io/meta.js @@ -120,13 +120,17 @@ SocketMeta.rooms.getAll = function(socket, data, callback) { } } else if (room.match(/^category/)) { socketData.users.category += roomClients[room].length; - } else if (room !== 'categories' && room !== 'recent_posts') { - socketData.users.other += roomClients[room].length; } } } + for (var i in socketData.users) { + if (socketData.users.hasOwnProperty(i)) { + socketData.users.other -= socketData.users[i]; + } + } + socketData.users.other += roomClients['online_users'].length; var scoreKeys = Object.keys(scores), mostActive = scoreKeys.sort();