Only reset Roster on clean termination

As otherwise the Roster would be still unitialized after a SM resumption
if the connection was uncleanly terminated.

Thanks to Grigory Fedorov for reporting this.
This commit is contained in:
Florian Schmaus 2016-04-15 17:41:50 +02:00
parent b043d9f5b5
commit fc3f5ef99e
1 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import org.jivesoftware.smack.AbstractConnectionClosedListener; import org.jivesoftware.smack.AbstractConnectionListener;
import org.jivesoftware.smack.ConnectionCreationListener; import org.jivesoftware.smack.ConnectionCreationListener;
import org.jivesoftware.smack.ExceptionCallback; import org.jivesoftware.smack.ExceptionCallback;
import org.jivesoftware.smack.Manager; import org.jivesoftware.smack.Manager;
@ -279,7 +279,7 @@ public final class Roster extends Manager {
}, PresenceTypeFilter.SUBSCRIBE); }, PresenceTypeFilter.SUBSCRIBE);
// Listen for connection events // Listen for connection events
connection.addConnectionListener(new AbstractConnectionClosedListener() { connection.addConnectionListener(new AbstractConnectionListener() {
@Override @Override
public void authenticated(XMPPConnection connection, boolean resumed) { public void authenticated(XMPPConnection connection, boolean resumed) {
@ -299,7 +299,7 @@ public final class Roster extends Manager {
} }
@Override @Override
public void connectionTerminated() { public void connectionClosed() {
// Changes the presence available contacts to unavailable // Changes the presence available contacts to unavailable
setOfflinePresencesAndResetLoaded(); setOfflinePresencesAndResetLoaded();
} }