aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-12-10 13:20:05 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-12-10 13:20:05 +0100
commit75ee14cfdf8a4ac975a7363f85dd02c82af870b1 (patch)
tree035bae80b0f26a43880db2665702597f41eb925b /src/main/java
parent55b60f6b0fa8ab0084cba30f82696f852debc1d6 (diff)
don't reconnect accout when system reports no internet connection
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 9dca00b0..38c1214a 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -2898,7 +2898,8 @@ public class XmppConnectionService extends Service {
connection = createConnection(account);
account.setXmppConnection(connection);
}
- if (!account.isOptionSet(Account.OPTION_DISABLED)) {
+ boolean hasInternet = hasInternetConnection();
+ if (!account.isOptionSet(Account.OPTION_DISABLED) && hasInternet) {
if (!force) {
disconnect(account, false);
}
@@ -2909,10 +2910,13 @@ public class XmppConnectionService extends Service {
thread.start();
scheduleWakeUpCall(Config.CONNECT_DISCO_TIMEOUT, account.getUuid().hashCode());
} else {
- disconnect(account, force || account.getTrueStatus().isError());
+ disconnect(account, force || account.getTrueStatus().isError() || !hasInternet);
account.getRoster().clearPresences();
connection.resetEverything();
account.getAxolotlService().resetBrokenness();
+ if (!hasInternet) {
+ account.setStatus(Account.State.NO_INTERNET);
+ }
}
}
}