sstrigler / JSJaC

JavaScript Jabber Client Library
Other
295 stars 86 forks source link

Handle WebSocket stream termination #72

Closed valeriansaliou closed 10 years ago

valeriansaliou commented 10 years ago

Hey guys, seems that JSJaC over WebSocket - although generally working great - doesn't call ondisconnect() when receiving a </stream:stream> packet through the WebSocket channel.

Thus, the server can never advertise a JSJaC client that its connection is closed (eg: when restarting the XMPP server or administratively closing user session).

This is equivalent to the BOSH packet.

valeriansaliou commented 10 years ago

Hey, I could get it fixed with the following code: https://github.com/jappix/jappix/commit/b589616913a987fef6712efe0593350f4e0088e2

It's a dirty copy & paste thing that do the trick, but I think there might be better fixes than the one I proceeded, I let you do that one since I have no idea how you want to architect it ;)

Cheers!