Ensure recycled messages don't reappear in threads

This commit is contained in:
Ensar Sarajčić 2023-07-20 16:26:00 +02:00
parent 565f991932
commit cc6e9358f6
1 changed files with 2 additions and 0 deletions

View File

@ -1543,6 +1543,8 @@ class ThreadActivity : SimpleActivity() {
val scheduledMessages = messagesDB.getScheduledThreadMessages(threadId) val scheduledMessages = messagesDB.getScheduledThreadMessages(threadId)
.filterNot { it.isScheduled && it.millis() < System.currentTimeMillis() } .filterNot { it.isScheduled && it.millis() < System.currentTimeMillis() }
addAll(scheduledMessages) addAll(scheduledMessages)
val recycledMessages = messagesDB.getThreadMessagesFromRecycleBin(threadId).toSet()
removeAll(recycledMessages)
} }
messages.filter { !it.isScheduled && !it.isReceivedMessage() && it.id > lastMaxId }.forEach { latestMessage -> messages.filter { !it.isScheduled && !it.isReceivedMessage() && it.id > lastMaxId }.forEach { latestMessage ->