From be86c74c912d12b95cf754873b2b9166efaf8d00 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 4 Nov 2015 12:52:55 -0500 Subject: [PATCH] disabled browsing users and global rooms syncing --- src/socket.io/index.js | 8 ++++++++ src/socket.io/meta.js | 22 +++++++++++----------- src/socket.io/rooms.js | 4 ++-- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/socket.io/index.js b/src/socket.io/index.js index fd3ab9e995..6201ec3297 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -263,6 +263,14 @@ Sockets.isUsersOnline = function(uids, callback) { }; Sockets.getUsersInRoom = function (uid, roomName, start, stop, callback) { + callback(null, { + users: [], + room: roomName, + total: 0, + hidden: 0 + }); + return; + if (!roomName) { return; } diff --git a/src/socket.io/meta.js b/src/socket.io/meta.js index c304833ef5..a77d893d32 100644 --- a/src/socket.io/meta.js +++ b/src/socket.io/meta.js @@ -52,14 +52,14 @@ SocketMeta.rooms.enter = function(socket, data, callback) { if (data.enter) { rooms.enter(socket, data.enter); socket.currentRoom = data.enter; - if (data.enter.indexOf('topic') !== -1) { - data.uid = socket.uid; - data.picture = validator.escape(data.picture); - data.username = validator.escape(data.username); - data.userslug = validator.escape(data.userslug); - - websockets.in(data.enter).emit('event:user_enter', data); - } + // if (data.enter.indexOf('topic') !== -1) { + // data.uid = socket.uid; + // data.picture = validator.escape(data.picture); + // data.username = validator.escape(data.username); + // data.userslug = validator.escape(data.userslug); + + // websockets.in(data.enter).emit('event:user_enter', data); + // } } callback(); }; @@ -75,9 +75,9 @@ SocketMeta.rooms.leaveCurrent = function(socket, data, callback) { function leaveCurrentRoom(socket) { if (socket.currentRoom) { rooms.leave(socket, socket.currentRoom); - if (socket.currentRoom.indexOf('topic') !== -1) { - websockets.in(socket.currentRoom).emit('event:user_leave', socket.uid); - } + // if (socket.currentRoom.indexOf('topic') !== -1) { + // websockets.in(socket.currentRoom).emit('event:user_leave', socket.uid); + // } socket.currentRoom = ''; } } diff --git a/src/socket.io/rooms.js b/src/socket.io/rooms.js index 615d650cd6..198288c3a9 100644 --- a/src/socket.io/rooms.js +++ b/src/socket.io/rooms.js @@ -19,12 +19,12 @@ var roomClients = {}; rooms.enter = function(socket, room) { socket.join(room); - pubsub.publish('socket:join', {id: socket.id, room: room}); + //pubsub.publish('socket:join', {id: socket.id, room: room}); }; rooms.leave = function(socket, room) { socket.leave(room); - pubsub.publish('socket:leave', {id: socket.id, room: room}); + //pubsub.publish('socket:leave', {id: socket.id, room: room}); }; rooms.leaveAll = function(socket, roomsToLeave) {