I saw several example of chat functionality on sails.js. However, all of them create one big chat where all users are placed.
How to create multiple chats (so messages posted in one chat isn't visible in another).
I am not sure that I understand the problem correctly. It looks like what happen is that client does io.socket.post('/message', { someMessageData })
and as result get subscribed to all messages.
Is there a way to filter it (on server side) that it got subscribed to messages only in one chat room.
I saw that sockets had id's. And if the server side was using directly socket.io, I would just collect list of id's to which a messages needs to be sent.
However, Sails.js hides this level. And as result, I am not sure how to configure this on the server.
I saw similar question. However, it's reasonably old (taking into account speed of changes in Sails.js). I am not sure where should I put the code regarding Model.subscribe and Model.publish, taking into account that it's all hidden by convention (so it looks like I need to override some default behavior when it subscribe automatically).