Skip to content

Commit

Permalink
Always use "conserve power" priority for challenge notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-signal committed Nov 21, 2023
1 parent 42a4740 commit ff7a5f4
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ public CompletableFuture<SendPushNotificationResult> sendNotification(final Push
pushType = notification.urgent() ? PushType.ALERT : PushType.BACKGROUND;
}

final DeliveryPriority deliveryPriority =
(notification.urgent() || isVoip) ? DeliveryPriority.IMMEDIATE : DeliveryPriority.CONSERVE_POWER;
final DeliveryPriority deliveryPriority = switch (notification.notificationType()) {
case NOTIFICATION ->
(notification.urgent() || isVoip) ? DeliveryPriority.IMMEDIATE : DeliveryPriority.CONSERVE_POWER;
case ATTEMPT_LOGIN_NOTIFICATION_HIGH_PRIORITY -> DeliveryPriority.IMMEDIATE;
case CHALLENGE, RATE_LIMIT_CHALLENGE -> DeliveryPriority.CONSERVE_POWER;
};

final String collapseId =
(notification.notificationType() == PushNotification.NotificationType.NOTIFICATION && notification.urgent() && !isVoip)
Expand Down

0 comments on commit ff7a5f4

Please sign in to comment.