1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-11 10:09:38 +02:00

Move getRoster() to XMPPConnection

Also remove the Exceptions from the signature of getRoster().

Extend ConnectionListener with connected() and authenticated()
callbacks, required by Roster to be notified so that the Roster can be
loaded *after* login.
This commit is contained in:
Florian Schmaus 2014-03-14 01:48:33 +01:00
parent 4b56446e40
commit 64e7b8a868
15 changed files with 193 additions and 260 deletions

View file

@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Random;
import java.util.logging.Logger;
import org.jivesoftware.smack.AbstractConnectionListener;
import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.SmackException;
@ -625,23 +626,16 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
*/
private void installConnectionListeners(final XMPPConnection connection) {
if (connection != null) {
connectionListener = new ConnectionListener() {
connectionListener = new AbstractConnectionListener() {
@Override
public void connectionClosed() {
unregisterInstanceFor(connection);
}
@Override
public void connectionClosedOnError(java.lang.Exception e) {
unregisterInstanceFor(connection);
}
public void reconnectingIn(int i) {
}
public void reconnectionSuccessful() {
}
public void reconnectionFailed(Exception exception) {
}
};
connection.addConnectionListener(connectionListener);
}