From a87f7903c678d696f7978cf63034032516027c5c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 24 Nov 2016 12:44:24 +0100 Subject: [PATCH] always force close a connection when disabling from error state --- src/main/java/eu/siacs/conversations/entities/Account.java | 4 ++++ .../siacs/conversations/services/XmppConnectionService.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java index e0bb6d1df..bb89cf17d 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 eba091846..b9aeffee5 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();