|
|
@@ -130,16 +130,13 @@ class SocketIoService {
|
|
|
|
|
|
setupDefaultSocketJoinRoomsEventHandler() {
|
|
|
this.io.on('connection', (socket) => {
|
|
|
- // TODO: check if i can get page information here and use or not TAICHI
|
|
|
- // TODO: join page rooms here if possible TAICHI
|
|
|
const user = socket.request.user;
|
|
|
if (user == null) {
|
|
|
logger.debug('Socket io: An anonymous user has connected');
|
|
|
return;
|
|
|
}
|
|
|
- // make a room for each user. it leaves automatically
|
|
|
- // TODO: avoid hard coding by using a utility function TAICHI
|
|
|
- socket.join(`user:${user._id}`);
|
|
|
+ // make a room for each user. the user will leave automatically
|
|
|
+ socket.join(getRoomNameWithId(RoomPrefix.USER, user._id));
|
|
|
|
|
|
socket.on('join:page', ({ pageId }) => {
|
|
|
socket.join(getRoomNameWithId(RoomPrefix.PAGE, pageId));
|