|
|
|
@ -538,16 +538,9 @@ public extension Interaction {
|
|
|
|
|
interactionInfo: [InteractionReadInfo],
|
|
|
|
|
lastReadTimestampMs: Int64
|
|
|
|
|
) throws {
|
|
|
|
|
// Update the last read timestamp if needed
|
|
|
|
|
try SessionUtil.syncThreadLastReadIfNeeded(
|
|
|
|
|
db,
|
|
|
|
|
threadId: threadId,
|
|
|
|
|
threadVariant: threadVariant,
|
|
|
|
|
lastReadTimestampMs: lastReadTimestampMs
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Add the 'DisappearingMessagesJob' if needed - this will update any expiring
|
|
|
|
|
// messages `expiresStartedAtMs` values
|
|
|
|
|
// messages `expiresStartedAtMs` values in local database, and create seperate
|
|
|
|
|
// jobs updating message expiration
|
|
|
|
|
JobRunner.upsert(
|
|
|
|
|
db,
|
|
|
|
|
job: DisappearingMessagesJob.updateNextRunIfNeeded(
|
|
|
|
@ -558,6 +551,14 @@ public extension Interaction {
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Update the last read timestamp if needed
|
|
|
|
|
try SessionUtil.syncThreadLastReadIfNeeded(
|
|
|
|
|
db,
|
|
|
|
|
threadId: threadId,
|
|
|
|
|
threadVariant: threadVariant,
|
|
|
|
|
lastReadTimestampMs: lastReadTimestampMs
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Clear out any notifications for the interactions we mark as read
|
|
|
|
|
Environment.shared?.notificationsManager.wrappedValue?.cancelNotifications(
|
|
|
|
|
identifiers: interactionInfo
|
|
|
|
|