aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-20 10:30:59 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-20 10:30:59 +0100
commita0ee7a6ff08cfb74cc7698f7d0aee7ed45ac7467 (patch)
tree393af1c2820682d3be9fb8738cf70135b81499ae /src/main/java/de/pixart/messenger/services
parent99a9148f594fb106b8ffb6b4283c27636087307f (diff)
don't reset last connect time on network change
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 96b98fbb3..f59fc1591 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -664,7 +664,7 @@ public class XmppConnectionService extends Service {
switch (action) {
case ConnectivityManager.CONNECTIVITY_ACTION:
if (hasInternetConnection() && Config.RESET_ATTEMPT_COUNT_ON_NETWORK_CHANGE) {
- resetAllAttemptCounts(true);
+ resetAllAttemptCounts(true, false);
}
break;
case ACTION_MERGE_PHONE_CONTACTS:
@@ -686,7 +686,7 @@ public class XmppConnectionService extends Service {
dismissErrorNotifications();
break;
case ACTION_TRY_AGAIN:
- resetAllAttemptCounts(false);
+ resetAllAttemptCounts(false, true);
interactive = true;
break;
case ACTION_REPLY_TO_CONVERSATION:
@@ -785,7 +785,7 @@ public class XmppConnectionService extends Service {
long timeout = Config.CONNECT_TIMEOUT - secondsSinceLastConnect;
if (timeout < 0) {
Log.d(Config.LOGTAG, account.getJid() + ": time out during connect reconnecting");
- account.getXmppConnection().resetAttemptCount();
+ account.getXmppConnection().resetAttemptCount(false);
reconnectAccount(account, true, interactive);
} else if (discoTimeout < 0) {
account.getXmppConnection().sendDiscoTimeout();
@@ -931,13 +931,13 @@ public class XmppConnectionService extends Service {
}
}
- private void resetAllAttemptCounts(boolean reallyAll) {
+ private void resetAllAttemptCounts(boolean reallyAll, boolean retryImmediately) {
Log.d(Config.LOGTAG, "resetting all attempt counts");
for (Account account : accounts) {
if (account.hasErrorStatus() || reallyAll) {
final XmppConnection connection = account.getXmppConnection();
if (connection != null) {
- connection.resetAttemptCount();
+ connection.resetAttemptCount(retryImmediately);
}
}
if (account.setShowErrorNotification(true)) {