|
|
|
@ -56,7 +56,7 @@ public extension DisappearingMessagesJob {
|
|
|
|
|
// If there is another expiring message then update the job to run 1 second after it's meant to expire
|
|
|
|
|
let nextExpirationTimestampMs: Double? = try? Interaction
|
|
|
|
|
.filter(Interaction.Columns.expiresStartedAtMs != nil)
|
|
|
|
|
.filter(Interaction.Columns.expiresInSeconds > 0)
|
|
|
|
|
.filter(Interaction.Columns.expiresInSeconds != 0)
|
|
|
|
|
.select(Interaction.Columns.expiresStartedAtMs + (Interaction.Columns.expiresInSeconds * 1000))
|
|
|
|
|
.order((Interaction.Columns.expiresStartedAtMs + (Interaction.Columns.expiresInSeconds * 1000)).asc)
|
|
|
|
|
.asRequest(of: Double.self)
|
|
|
|
@ -88,7 +88,7 @@ public extension DisappearingMessagesJob {
|
|
|
|
|
.filter(
|
|
|
|
|
Interaction.Columns.threadId == threadId &&
|
|
|
|
|
Interaction.Columns.timestampMs <= lastReadTimestampMs &&
|
|
|
|
|
Interaction.Columns.expiresInSeconds > 0 &&
|
|
|
|
|
Interaction.Columns.expiresInSeconds != 0 &&
|
|
|
|
|
Interaction.Columns.expiresStartedAtMs == nil
|
|
|
|
|
)
|
|
|
|
|
.select(
|
|
|
|
@ -129,7 +129,7 @@ public extension DisappearingMessagesJob {
|
|
|
|
|
let interactionExpirationInfosByExpiresInSeconds: [TimeInterval: [ExpirationInfo]] = (try? Interaction
|
|
|
|
|
.filter(interactionIds.contains(Interaction.Columns.id))
|
|
|
|
|
.filter(
|
|
|
|
|
Interaction.Columns.expiresInSeconds > 0 &&
|
|
|
|
|
Interaction.Columns.expiresInSeconds != 0 &&
|
|
|
|
|
Interaction.Columns.expiresStartedAtMs == nil
|
|
|
|
|
)
|
|
|
|
|
.select(
|
|
|
|
@ -146,7 +146,7 @@ public extension DisappearingMessagesJob {
|
|
|
|
|
let changeCount: Int? = try? Interaction
|
|
|
|
|
.filter(interactionIds.contains(Interaction.Columns.id))
|
|
|
|
|
.filter(
|
|
|
|
|
Interaction.Columns.expiresInSeconds > 0 &&
|
|
|
|
|
Interaction.Columns.expiresInSeconds != 0 &&
|
|
|
|
|
Interaction.Columns.expiresStartedAtMs == nil
|
|
|
|
|
)
|
|
|
|
|
.updateAll(
|
|
|
|
|