From 99d229bb45ced1aacc18b273459b5562061f725c Mon Sep 17 00:00:00 2001 From: Paride Legovini Date: Thu, 11 May 2017 12:34:47 +0200 Subject: [PATCH] Don't connect to server if !isPushRegistered Partial fix for #6620. Closes #6627 // FREEBIE --- .../securesms/service/MessageRetrievalService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java b/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java index 4d257c9737..7d7ad0b0f2 100644 --- a/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java +++ b/src/org/thoughtcrime/securesms/service/MessageRetrievalService.java @@ -144,7 +144,8 @@ public class MessageRetrievalService extends Service implements InjectableType, Log.w(TAG, String.format("Network requirement: %s, active activities: %s, push pending: %s, gcm disabled: %b", networkRequirement.isPresent(), activeActivities, pushPending.size(), isGcmDisabled)); - return TextSecurePreferences.isWebsocketRegistered(this) && + return TextSecurePreferences.isPushRegistered(this) && + TextSecurePreferences.isWebsocketRegistered(this) && (activeActivities > 0 || !pushPending.isEmpty() || isGcmDisabled) && networkRequirement.isPresent(); }