WIP: fix disappear after read for message sender

pull/941/head
ryanzhao 1 year ago
parent ee490bfa99
commit 963b3f6029

@ -515,8 +515,10 @@ extension ConversationVC:
).insert(db)
}
// If there is a Quote the insert it now
if let interactionId: Int64 = interaction.id, let quoteModel: QuotedReplyModel = quoteModel {
guard let interactionId: Int64 = interaction.id else { return }
// If there is a Quote then insert it now
if let quoteModel: QuotedReplyModel = quoteModel {
try Quote(
interactionId: interactionId,
authorId: quoteModel.authorId,
@ -532,6 +534,16 @@ extension ConversationVC:
threadId: threadId,
threadVariant: threadVariant
)
// Trigger disappear after read
try Interaction.markAsRead(
db,
interactionId: interactionId,
threadId: threadId,
threadVariant: threadVariant,
includingOlder: false,
trySendReadReceipt: false
)
}
.subscribe(on: DispatchQueue.global(qos: .userInitiated))
.sinkUntilComplete(
@ -633,6 +645,16 @@ extension ConversationVC:
threadId: threadId,
threadVariant: threadVariant
)
// Trigger disappear after read
try Interaction.markAsRead(
db,
interactionId: interactionId,
threadId: threadId,
threadVariant: threadVariant,
includingOlder: false,
trySendReadReceipt: false
)
}
.subscribe(on: DispatchQueue.global(qos: .userInitiated))
.sinkUntilComplete(

@ -379,7 +379,7 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu
disappearingMessagesConfiguration.isEnabled
{
self.expiresInSeconds = disappearingMessagesConfiguration.durationSeconds
if self.variant == .standardOutgoing || disappearingMessagesConfiguration.type == .disappearAfterSend {
if disappearingMessagesConfiguration.type == .disappearAfterSend {
self.expiresStartedAtMs = Double(self.timestampMs)
}
}

Loading…
Cancel
Save