diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-10-08 10:31:46 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-10-08 10:31:46 +0200 |
commit | ecf2d7c0930ec9031cdce8360a1d8009882b3c36 (patch) | |
tree | 417d00ebb0d2896344813cf37ffbd260cbd35d54 /src/main/java/de/pixart/messenger/services | |
parent | 3d765be798645d1ae6f05775fb4e92a181f808c2 (diff) |
issue ping after push was received
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 3eccd9565..c00bde90b 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -616,6 +616,7 @@ public class XmppConnectionService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { final String action = intent == null ? null : intent.getAction(); + String pushedAccountHash = null; boolean interactive = false; if (action != null) { final Conversation c = findConversationByUuid(intent.getStringExtra("uuid")); @@ -679,6 +680,7 @@ public class XmppConnectionService extends Service { break; case ACTION_GCM_MESSAGE_RECEIVED: Log.d(Config.LOGTAG,"gcm push message arrived in service. extras="+intent.getExtras()); + pushedAccountHash = intent.getStringExtra("account"); break; } } @@ -717,7 +719,7 @@ public class XmppConnectionService extends Service { } } else { pingCandidates.add(account); - if (msToNextPing <= 0) { + if (msToNextPing <= 0 || CryptoHelper.getAccountFingerprint(account).equals(pushedAccountHash)) { pingNow = true; } else { this.scheduleWakeUpCall((int) (msToNextPing / 1000), account.getUuid().hashCode()); |