From d9eb2c75852f1ddbd4c9c9bf0a738e82dc54555a Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Tue, 17 Aug 2021 15:11:53 +1000 Subject: [PATCH] don't show delete options for old messages --- .../securesms/conversation/v2/ConversationActivityV2.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt index fec9dcc558..f8772bff45 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/v2/ConversationActivityV2.kt @@ -1223,6 +1223,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe return } val allSentByCurrentUser = messages.all { it.isOutgoing } + val allHasHash = messages.all { DatabaseFactory.getLokiMessageDatabase(this@ConversationActivityV2).getMessageServerHash(it.id) != null } if (thread.isOpenGroupRecipient) { val messageCount = messages.size val builder = AlertDialog.Builder(this) @@ -1240,7 +1241,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe endActionMode() } builder.show() - } else if (allSentByCurrentUser) { + } else if (allSentByCurrentUser && allHasHash) { val bottomSheet = DeleteOptionsBottomSheet() bottomSheet.recipient = thread bottomSheet.onDeleteForMeTapped = {