From cc6e9358f6c5e85c5976ae003e61842484f72dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Thu, 20 Jul 2023 16:26:00 +0200 Subject: [PATCH] Ensure recycled messages don't reappear in threads --- .../simplemobiletools/smsmessenger/activities/ThreadActivity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt index 9e9e4ebd..bbb98cbf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt @@ -1543,6 +1543,8 @@ class ThreadActivity : SimpleActivity() { val scheduledMessages = messagesDB.getScheduledThreadMessages(threadId) .filterNot { it.isScheduled && it.millis() < System.currentTimeMillis() } addAll(scheduledMessages) + val recycledMessages = messagesDB.getThreadMessagesFromRecycleBin(threadId).toSet() + removeAll(recycledMessages) } messages.filter { !it.isScheduled && !it.isReceivedMessage() && it.id > lastMaxId }.forEach { latestMessage ->