aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-20 10:49:26 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-20 10:49:26 +0100
commit75bf91fd857577d0ce4ee7dec9586a721fa59002 (patch)
treeaa20137cbc7bc6030768c61279dab073665d4552 /src/main
parenta969706f409cc45d267bddc11acc68a5d9deba16 (diff)
issue ping after network change
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java6
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/XmppConnection.java2
2 files changed, 3 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 d9bf5f7f0..d0b2718d4 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -728,7 +728,7 @@ public class XmppConnectionService extends Service {
}
synchronized (this) {
this.wakeLock.acquire();
- boolean pingNow = false;
+ boolean pingNow = ConnectivityManager.CONNECTIVITY_ACTION.equals(action);
HashSet<Account> pingCandidates = new HashSet<>();
for (Account account : accounts) {
pingNow |= processAccountState(account,
@@ -756,8 +756,6 @@ public class XmppConnectionService extends Service {
}
private boolean processAccountState(Account account, boolean interactive, boolean isUiAction, boolean isAccountPushed, HashSet<Account> pingCandidates) {
-
-
boolean pingNow = false;
if (!account.isOptionSet(Account.OPTION_DISABLED)) {
if (!hasInternetConnection()) {
@@ -814,7 +812,7 @@ public class XmppConnectionService extends Service {
long discoTimeout = Config.CONNECT_DISCO_TIMEOUT - secondsSinceLastDisco;
long timeout = Config.CONNECT_TIMEOUT - secondsSinceLastConnect;
if (timeout < 0) {
- Log.d(Config.LOGTAG, account.getJid() + ": time out during connect reconnecting");
+ Log.d(Config.LOGTAG, account.getJid() + ": time out during connect reconnecting (secondsSinceLast="+secondsSinceLastConnect+")");
account.getXmppConnection().resetAttemptCount(false);
reconnectAccount(account, true, interactive);
} else if (discoTimeout < 0) {
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
index 657c9b71a..dde2a639e 100644
--- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
@@ -969,7 +969,7 @@ public class XmppConnection implements Runnable {
}
public void resetEverything() {
- resetAttemptCount();
+ resetAttemptCount(true);
resetStreamId();
clearIqCallbacks();
mStanzaQueue.clear();