1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-14 09:01:08 +01:00

Add 'resumed' bool ConnectionListener's authenticated()

It's important to know if the stream was resumed. authenticated() is the
ideal callback for Managers to reset their state (e.g. cached values of
the connection state). But if the stream was resumed, the cached values
don't have to be reset.
This commit is contained in:
Florian Schmaus 2015-01-07 20:19:04 +01:00
parent 3dd1365a5a
commit e380872a41
10 changed files with 38 additions and 20 deletions

View file

@ -186,7 +186,11 @@ public class PrivacyListManager extends Manager {
}, PRIVACY_RESULT);
connection.addConnectionListener(new AbstractConnectionListener() {
@Override
public void reconnectionSuccessful() {
public void authenticated(XMPPConnection connection, boolean resumed) {
// No need to reset the cache if the connection got resumed.
if (resumed) {
return;
}
cachedActiveListName = cachedDefaultListName = null;
}
});