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:
parent
b043d9f5b5
commit
fc3f5ef99e
1 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue