only update room text if its topic

will fix this in a better way
This commit is contained in:
barisusakli
2014-09-04 23:26:55 -04:00
parent e28d778c0c
commit 190647a074
2 changed files with 8 additions and 8 deletions

View File

@@ -188,7 +188,9 @@ Sockets.init = function(server) {
emitOnlineUserCount();
for(var roomName in io.sockets.manager.roomClients[socket.id]) {
updateRoomBrowsingText(roomName.slice(1));
if (roomName.indexOf('topic') !== -1) {
updateRoomBrowsingText(roomName.slice(1));
}
}
});

View File

@@ -72,15 +72,13 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
socket.join(data.enter);
if (data.leave && data.leave !== data.enter) {
if (data.leave && data.leave !== data.enter && data.leave.indexOf('topic') !== -1) {
module.parent.exports.updateRoomBrowsingText(data.leave);
}
module.parent.exports.updateRoomBrowsingText(data.enter);
//if (data.enter !== 'admin') {
// websockets.in('admin').emit('event:meta.rooms.update', null, websockets.server.sockets.manager.rooms);
//}
if (data.enter.indexOf('topic') !== -1) {
module.parent.exports.updateRoomBrowsingText(data.enter);
}
};
SocketMeta.rooms.getAll = function(socket, data, callback) {
@@ -88,7 +86,7 @@ SocketMeta.rooms.getAll = function(socket, data, callback) {
onlineGuestCount: websockets.getOnlineAnonCount(),
onlineRegisteredCount: websockets.getConnectedClients().length,
rooms: websockets.server.sockets.manager.rooms
}
};
callback(null, userData);
};