metajack/strophejs — pull request #74 by patters (2012-01-13 13:42:19+00:00)
Title: added synchronous mode to disconnect()

I've added a 'synchronous' property to Strophe.Connection. This is forcibly set to true in an update to disconnect which now takes two arguments:

disconnect(reason, synchronously)

This allows Strophe to inform the XMPP server that the resource should be disconnected inside of a window.onunload handler. If session termination is handled asynchronously in this method, it is never processed by the server.

The synchronous property could be used in other ways, if desired. It is set to false in the Connection initialization (but in connection reset).