closes #2035, closes #2036

This commit is contained in:
barisusakli
2014-09-02 05:04:39 -04:00
parent ff46d1211d
commit 171f02101d
10 changed files with 45 additions and 74 deletions

View File

@@ -282,6 +282,22 @@ function isUserOnline(uid) {
return Sockets.getUserSockets(uid).length > 0;
}
Sockets.isUsersOnline = function(uids, callback) {
var sockets = io.sockets.clients();
if(!Array.isArray(sockets) || !sockets.length) {
return callback(null, []);
}
sockets = sockets.map(function(s) {
return s.uid;
});
callback(null, uids.map(function(uid) {
return sockets.indexOf(parseInt(uid, 10)) !== -1;
}));
};
Sockets.updateRoomBrowsingText = updateRoomBrowsingText;
function updateRoomBrowsingText(roomName) {