Closed hems closed 9 years ago
This should be closed now cause we are not dealing with listener:removed event anymore
@stefanoortisi we actually dealing with listener:removed !
if the user closes the browser or leave the room this event will go and we have to remove his avatar from the "PEOPLE IN THE ROOM" list
@stefanoortisi close this issue if people are leaving the room just by closing the browser, because if you leave by internet connection drop or closing browser or tab it also should receive the listener:removed event!
alright :+1:
Ok now the listener:removed event is starting to work. But i have still a small issue: if a guest is already into the chat, i get him on the list when i enter the chat. But if a guest enters while I'm on the room, i don't get any listener:added event.
I double checked if i was actually calling the chat/enter api for logged and unlogged user and i am doing it right.
@hems could you have a look at this particular case?
@stefanoortisi i don't know why, but i had a "null" on the room_id for guests!
now it's fixed!
this seems to be working very well!
with guests and users! pretty cool
A few points regarding the updated implementation:
L.rooms.people
we will get a list of users and every user has asocket_id
property.listener:removed
chat/leave
method anymore, or use thechat.listener
method to notify the user left because thetype: 'listener:removed'
message will be sent automatically when a user unsubscribe from a room or when a user socket connection is closed ( for instance when the user closes the browser )So basically, from the HTTP API we will only need to call
chat/enter
becausechat/leave
( and the messagetype: 'listener:removed'
will now be handled server-side by watching the socket connection.There is more information about leaving on the ticket #338 !
After doing this, i believe we can delete the API method
chat/listener
, because it was being used just to propaged thelistener:added
and`listener:removed
, and now we will replaced both operations, does that make sense or did i understand something wrong?