feat: do not update messages' ttl until the new design is enabled

pull/941/head
Ryan Zhao 2 years ago
parent a33df00363
commit 4225ba6a04

@ -90,6 +90,7 @@ public extension DisappearingMessagesJob {
// If there were no changes then none of the provided `interactionIds` are expiring messages // If there were no changes then none of the provided `interactionIds` are expiring messages
guard (changeCount ?? 0) > 0 else { return nil } guard (changeCount ?? 0) > 0 else { return nil }
if DisappearingMessagesConfiguration.isNewConfigurationEnabled {
interactionsByExpiresInSeconds?.forEach { expiresInSeconds, interactions in interactionsByExpiresInSeconds?.forEach { expiresInSeconds, interactions in
let serverHashes = interactions.compactMap { $0.serverHash } let serverHashes = interactions.compactMap { $0.serverHash }
guard let expiresInSeconds = expiresInSeconds, !serverHashes.isEmpty else { return } guard let expiresInSeconds = expiresInSeconds, !serverHashes.isEmpty else { return }
@ -127,6 +128,7 @@ public extension DisappearingMessagesJob {
) )
.retainUntilComplete() .retainUntilComplete()
} }
}
return updateNextRunIfNeeded(db) return updateNextRunIfNeeded(db)
} }

Loading…
Cancel
Save