mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
user onlineUsers instead of calculating from rooms
This commit is contained in:
@@ -287,14 +287,7 @@ Sockets.getUserSocketCount = function(uid) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Sockets.getOnlineUserCount = function () {
|
Sockets.getOnlineUserCount = function () {
|
||||||
var roomNames = Object.keys(io.sockets.manager.rooms);
|
return onlineUsers.length;
|
||||||
if (!Array.isArray(roomNames)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
roomNames = roomNames.filter(function(name) {
|
|
||||||
return name.indexOf('/uid_') === 0;
|
|
||||||
});
|
|
||||||
return roomNames.length;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Sockets.getOnlineAnonCount = function () {
|
Sockets.getOnlineAnonCount = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user