1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 07:42:06 +01:00

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

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();
} }