Fire reconnectionSuccessful event when session is established
Description
If a connection was closed due to an exception and the connection is reconnected, the ConnectionListener#reconnectionSuccessful method will be invoked by the XMPPConnection (or the PacketReader in more detail) before the connection is fully restored. This means all Listeners have to wait until the connection is authenticated and established to start their work. This isn't very comfortable, deterministic and have the risk that some actions times out or stuck within a undefined state.
Walter Ebeling reported that sometimes when Spark was reconnected all roster presence infos are lost and listed as offline. In my opinion this is a result of the current behavior of the org.jivesoftware.spark.ui.ContactList#clientReconnected task which pauses and try after 5 seconds to send the users presence. If these 5 seconds aren't enough (maybe high load on the server side or slow connection) all roster items will be marked as offline.
If a connection was closed due to an exception and the connection is reconnected, the
ConnectionListener#reconnectionSuccessful
method will be invoked by theXMPPConnection
(or thePacketReader
in more detail) before the connection is fully restored. This means all Listeners have to wait until the connection is authenticated and established to start their work. This isn't very comfortable, deterministic and have the risk that some actions times out or stuck within a undefined state.