always force close a connection when disabling from error state

This commit is contained in:
Daniel Gultsch 2016-11-24 12:44:24 +01:00
parent 1e59a9517a
commit a87f7903c6
2 changed files with 5 additions and 1 deletions

View file

@ -341,6 +341,10 @@ public class Account extends AbstractEntity {
} }
} }
public State getTrueStatus() {
return this.status;
}
public void setStatus(final State status) { public void setStatus(final State status) {
this.status = status; this.status = status;
} }

View file

@ -2909,7 +2909,7 @@ public class XmppConnectionService extends Service {
thread.start(); thread.start();
scheduleWakeUpCall(Config.CONNECT_DISCO_TIMEOUT, account.getUuid().hashCode()); scheduleWakeUpCall(Config.CONNECT_DISCO_TIMEOUT, account.getUuid().hashCode());
} else { } else {
disconnect(account, force); disconnect(account, force || account.getTrueStatus().isError());
account.getRoster().clearPresences(); account.getRoster().clearPresences();
connection.resetEverything(); connection.resetEverything();
account.getAxolotlService().resetBrokenness(); account.getAxolotlService().resetBrokenness();