From 7ed987b61a84a545d50971f11a05e274f43d8d6e Mon Sep 17 00:00:00 2001 From: ThomasSession Date: Mon, 14 Oct 2024 16:16:13 +1100 Subject: [PATCH] Making sure deleted control messages leave nothing behind --- .../securesms/conversation/v2/ConversationViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt index 1dbefe7bc0..a16695d5d2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationViewModel.kt @@ -312,8 +312,8 @@ class ConversationViewModel( .mapNotNull { it.slideDeck.audioSlide } .forEach(::stopMessageAudio) - // if the message was already marked as deleted, remove it from the db instead - if(messages.all { it.isDeleted }){ + // if the message was already marked as deleted or control messages, remove it from the db instead + if(messages.all { it.isDeleted || it.isControlMessage }){ // Remove the message locally (leave nothing behind) repository.deleteMessages(messages = messages, threadId = threadId) } else {