diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-10-26 22:19:12 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-10-26 22:19:12 +0200 |
commit | be98df698041deedb14c7daa9798d4ca876de166 (patch) | |
tree | 30283390d0c8c280819cfb882c963b2e9ced1564 /src/main/java | |
parent | b6248fe4b98afa8750dea3ca33541ffd80341c41 (diff) |
connect instantly in low ping mode after going offline
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index e694bf3f0..d586bdd3f 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -348,8 +348,13 @@ public class XmppConnectionService extends Service { && listeners; Log.d(Config.LOGTAG,account.getJid().toBareJid()+": push mode="+Boolean.toString(pushMode)+" listeners="+Boolean.toString(listeners)); if (!disabled && !pushMode) { - int timeToReconnect = mRandom.nextInt(20) + 10; - scheduleWakeUpCall(timeToReconnect, account.getUuid().hashCode()); + if (mLowPingTimeoutMode.contains(account.getJid().toBareJid())) { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": went into offline state during low ping mode. reconnecting now"); + reconnectAccount(account,true,false); + } else { + int timeToReconnect = mRandom.nextInt(20) + 10; + scheduleWakeUpCall(timeToReconnect, account.getUuid().hashCode()); + } } } else if (account.getStatus() == Account.State.REGISTRATION_SUCCESSFUL) { databaseBackend.updateAccount(account); |