dont remove self from browsing

This commit is contained in:
Barış Soner Uşaklı
2015-02-19 12:04:53 -05:00
parent d09fcbaef0
commit 8eb45fc80a
2 changed files with 8 additions and 5 deletions

View File

@@ -278,9 +278,10 @@ Sockets.getUsersInRoom = function (uid, roomName, callback) {
var uids = Sockets.getUidsInRoom(roomName);
var total = uids.length;
uids = uids.slice(0, 9);
if (uid) {
if (uid && uids.indexOf(uid.toString()) === -1) {
uids = [uid].concat(uids);
}
if (!uids.length) {
return callback(null, {users: [], total: 0 , room: roomName});
}