powered by Jive Software

Another Bug? ROOM_LEAVE event never dispatched

I think I have found another bug in the XIFF code. In Room.as, in method leave(), the roster is cleared and the Message, Presence, and Disconnect event listeners are removed from the connection object. Since the LEAVE event is produced as a result of receiving the presence acknowledgment from the server, the listeners have been removed already by the time the acknowledgement arrives … thus, no ROOM_LEAVE event. Would it not be better to remove the listeners after the presence acknowledgement is received and ROOM_LEAVE has been dispatched?

Again, I may be forced to modify the code myself to fix the problem, but it would be good if it was fixed in the baseline so I (and others?) don’'t have to merge our changes into the next release.

Thoughts? Suggestions?

Bill Bailey

I removed the removeAll(), and the three removeEventListener() calls from the leave() method and moved them instead to just after receiving the presence(unavailable) acknowledgement from the server and just before dispatching the ROOM_LEAVE event. It now works … in fact, I am also getting USER_DEPARTURE event which I was not getting before. Admittedly, these events are not usually critical since you have have left the room or have been disconnected from the server, BUT if they are advertised they really should be dispatched. My only concern now is that I have overlooked something and this move might affect something else … I don’‘t think so, but I can’'t rule it out since I am not intimately familiar with all of the source code. If anyone sees any potential problems with this, I would be interested to hear it … and any alternative ideas for solutions. Thanks.

Bill Bailey