From cb59a1af2d5a22607a965ee74429594eef0f80a8 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 13 Aug 2021 15:49:05 +1000 Subject: [PATCH] minor fix --- .../conversation/v2/ConversationActivityV2.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 a6e2426355..1ac56afd9b 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 @@ -1155,7 +1155,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe } } } else { - messageDataProvider.getServerHashForMessage(message.id)?.let { serverHash -> + val serverHash = messageDataProvider.getServerHashForMessage(message.id) + if (serverHash == null) { + messageDataProvider.deleteMessage(message.id, !message.isMms) + } else { SnodeAPI.deleteMessage(thread.address.serialize(), listOf(serverHash)) .success { messageDataProvider.deleteMessage(message.id, !message.isMms) @@ -1192,14 +1195,19 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe this.deleteLocally(message) } bottomSheet.dismiss() + endActionMode() } bottomSheet.onDeleteForEveryoneTapped = { for (message in messages) { this.deleteForEveryone(message) } bottomSheet.dismiss() + endActionMode() + } + bottomSheet.onCancelTapped = { + bottomSheet.dismiss() + endActionMode() } - bottomSheet.onCancelTapped = { bottomSheet.dismiss() } bottomSheet.show(supportFragmentManager, bottomSheet.tag) } }