mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 00:45:47 +01:00
fix user presence graph
if nobody's using your forum at all, this thing stopped working altogether
This commit is contained in:
@@ -96,7 +96,8 @@ SocketMeta.rooms.getAll = function(socket, data, callback) {
|
||||
categories: roomClients.categories ? roomClients.categories.length : 0,
|
||||
recent: roomClients.recent_posts ? roomClients.recent_posts.length : 0,
|
||||
topics: 0,
|
||||
category: 0
|
||||
category: 0,
|
||||
other: 0
|
||||
},
|
||||
topics: {}
|
||||
};
|
||||
@@ -119,10 +120,14 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
var scoreKeys = Object.keys(scores),
|
||||
mostActive = scoreKeys.sort();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user