From b7f627f03c5c41fbcb215a78e54a0450b10295b6 Mon Sep 17 00:00:00 2001 From: alansley Date: Wed, 21 Aug 2024 14:54:17 +1000 Subject: [PATCH] Made closed group deleting-someone-elses msgs use 'Delete message' or 'Delete Messages' appropriately --- .../org/thoughtcrime/securesms/DeleteMediaPreviewDialog.kt | 2 +- .../securesms/conversation/v2/ConversationActivityV2.kt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/DeleteMediaPreviewDialog.kt b/app/src/main/java/org/thoughtcrime/securesms/DeleteMediaPreviewDialog.kt index 01c6fb00ce..37c0d75b10 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/DeleteMediaPreviewDialog.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/DeleteMediaPreviewDialog.kt @@ -11,7 +11,7 @@ class DeleteMediaPreviewDialog { iconAttribute(R.attr.dialog_alert_icon) title(R.string.deleteMessage) text(R.string.deleteMessageDescriptionEveryone) - button(R.string.delete) { doDelete.run() } + dangerButton(R.string.delete) { doDelete.run() } cancelButton() } } 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 a12546af29..4460459ce2 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 @@ -2119,9 +2119,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe else // Finally, if this is a closed group and you are deleting someone else's message(s) then we can only delete locally. { showSessionDialog { - title(resources.getString(R.string.deleteMessage)) - text(resources.getString(R.string.deleteMessageDescriptionEveryone)) - button(R.string.delete) { messages.forEach(viewModel::deleteLocally); endActionMode() } + val titleTxtId = if (messages.size == 1) { R.string.deleteMessage } else { R.string.deleteMessages } + title(resources.getString(titleTxtId)) + text(resources.getString(R.string.deleteMessageDescriptionDevice)) + dangerButton(R.string.delete) { messages.forEach(viewModel::deleteLocally); endActionMode() } cancelButton(::endActionMode) } }