Fix notification profile overrides.

This commit is contained in:
Michelle Tang
2025-12-16 15:18:18 -05:00
committed by jeffrey-signal
parent df6d446e83
commit e1454cfc6a
2 changed files with 3 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ object NotificationProfiles {
@JvmStatic
@JvmOverloads
fun getActiveProfile(profiles: List<NotificationProfile>, now: Long = System.currentTimeMillis(), zoneId: ZoneId = ZoneId.systemDefault()): NotificationProfile? {
fun getActiveProfile(profiles: List<NotificationProfile>, now: Long = System.currentTimeMillis(), zoneId: ZoneId = ZoneId.systemDefault(), shouldSync: Boolean = false): NotificationProfile? {
val storeValues: NotificationProfileValues = SignalStore.notificationProfile
val localNow: LocalDateTime = now.toLocalDateTime(zoneId)
@@ -41,7 +41,7 @@ object NotificationProfiles {
profile.schedule.startDateTime(localNow).toMillis(zoneId.toOffset()) > storeValues.manuallyDisabledAt
}
if (shouldClearManualOverride(manualProfile, scheduledProfile)) {
if (shouldSync && shouldClearManualOverride(manualProfile, scheduledProfile)) {
SignalExecutors.UNBOUNDED.execute {
SignalDatabase.recipients.markNeedsSync(Recipient.self().id)
StorageSyncHelper.scheduleSyncForDataChange()