Don't connect to server if !isPushRegistered

Partial fix for #6620.
Closes #6627
// FREEBIE
This commit is contained in:
Paride Legovini 2017-05-11 12:34:47 +02:00 committed by Moxie Marlinspike
parent 3d7331159f
commit 99d229bb45

View File

@ -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", Log.w(TAG, String.format("Network requirement: %s, active activities: %s, push pending: %s, gcm disabled: %b",
networkRequirement.isPresent(), activeActivities, pushPending.size(), isGcmDisabled)); networkRequirement.isPresent(), activeActivities, pushPending.size(), isGcmDisabled));
return TextSecurePreferences.isWebsocketRegistered(this) && return TextSecurePreferences.isPushRegistered(this) &&
TextSecurePreferences.isWebsocketRegistered(this) &&
(activeActivities > 0 || !pushPending.isEmpty() || isGcmDisabled) && (activeActivities > 0 || !pushPending.isEmpty() || isGcmDisabled) &&
networkRequirement.isPresent(); networkRequirement.isPresent();
} }