What is the best way to keep track of what chatroom user is in?


Hi, I’m building a chatroom in blaze where an admin see’s all the users logged in, he can click a non-admin user which would then initiate a chat room to open.

My first approach was by creating a new collection onCreateUser with the same id as the user. And then when the admin clicks on a non-admin user, the admin and user will then both subscribe to the collection and be able to see the chat room.

This is really gross, as its difficult to track when each user disconnects, logs off etc and it is difficult to limit 1 on 1 connection. Is there a better process I could do instead which would help? Thanks in advance


I’d recommend checking out socialize:messaging