This handles the fact that when using the /sync endpoint, events for already joined rooms are also in the "join" dictionary in the response. The firing of the "joined" event is moved to client:_make_room() and done only the first time that the room creation is requested. This also fixes bogus behavior: previosly, when a message was sent to a room there would be multiople places where the "joined" event would be fired, and message events pushed multile times onto the room object, which would call the event handlers more than once for each message. Ugh.
13 KiB
13 KiB