mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 16:38:39 +01:00
Only update devices that aren't already disabled
This commit is contained in:
@@ -112,7 +112,7 @@ public class ProcessPushNotificationFeedbackCommand extends AbstractSinglePassCr
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
boolean deviceNeedsUpdate(final Device device) {
|
||||
boolean pushFeedbackIntervalElapsed(final Device device) {
|
||||
// After we get an indication that a device may have uninstalled the Signal app (`uninstalledFeedbackTimestamp` is
|
||||
// non-zero), check back in after a few days to see what ultimately happened.
|
||||
return device.getUninstalledFeedbackTimestamp() != 0 &&
|
||||
@@ -129,6 +129,11 @@ public class ProcessPushNotificationFeedbackCommand extends AbstractSinglePassCr
|
||||
return Instant.ofEpochMilli(device.getLastSeen()).plus(MAX_TOKEN_REFRESH_DELAY).isBefore(clock.instant());
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
boolean deviceNeedsUpdate(final Device device) {
|
||||
return pushFeedbackIntervalElapsed(device) && (device.isEnabled() || device.getLastSeen() > device.getUninstalledFeedbackTimestamp());
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
static Optional<String> getUserAgent(final Device device) {
|
||||
if (StringUtils.isNotBlank(device.getApnId())) {
|
||||
|
||||
Reference in New Issue
Block a user