aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-11-24 12:44:24 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-11-24 12:44:24 +0100
commita87f7903c678d696f7978cf63034032516027c5c (patch)
treef8e0690f5616cf13be16bea0611479f797fa6ab4 /src/main
parent1e59a9517a0fa4e50b0689f8f35b3dac4e243285 (diff)
always force close a connection when disabling from error state
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Account.java4
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java
index e0bb6d1d..bb89cf17 100644
--- a/src/main/java/eu/siacs/conversations/entities/Account.java
+++ b/src/main/java/eu/siacs/conversations/entities/Account.java
@@ -341,6 +341,10 @@ public class Account extends AbstractEntity {
}
}
+ public State getTrueStatus() {
+ return this.status;
+ }
+
public void setStatus(final State status) {
this.status = status;
}
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index eba09184..b9aeffee 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -2909,7 +2909,7 @@ public class XmppConnectionService extends Service {
thread.start();
scheduleWakeUpCall(Config.CONNECT_DISCO_TIMEOUT, account.getUuid().hashCode());
} else {
- disconnect(account, force);
+ disconnect(account, force || account.getTrueStatus().isError());
account.getRoster().clearPresences();
connection.resetEverything();
account.getAxolotlService().resetBrokenness();