Change summary
src/main/java/eu/siacs/conversations/entities/Account.java | 5 ++++
src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 6 ++++
2 files changed, 10 insertions(+), 1 deletion(-)
Detailed changes
@@ -362,6 +362,11 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable
this.fastToken = token;
}
+ public void resetFastToken() {
+ this.fastMechanism = null;
+ this.fastToken = null;
+ }
+
public void resetPinnedMechanism() {
this.pinnedMechanism = null;
this.pinnedChannelBinding = null;
@@ -840,7 +840,11 @@ public class XmppConnection implements Runnable {
}
Log.d(Config.LOGTAG,failure.toString());
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": login failure " + version);
- //TODO check if we are doing FAST; reset token
+ if (this.saslMechanism instanceof HashedToken) {
+ Log.d(Config.LOGTAG,account.getJid().asBareJid() + ": resetting token");
+ account.resetFastToken();
+ mXmppConnectionService.databaseBackend.updateAccount(account);
+ }
if (failure.hasChild("temporary-auth-failure")) {
throw new StateChangingException(Account.State.TEMPORARY_AUTH_FAILURE);
} else if (failure.hasChild("account-disabled")) {