From 9646ea580fa4a4f3c7c0fac00af71d589794a296 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Mon, 15 May 2023 11:44:11 +1000 Subject: [PATCH] fix: prevent block of users in delete all --- .../securesms/messagerequests/MessageRequestsActivity.kt | 6 +++--- .../securesms/repository/ConversationRepository.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt index aa2d98e6de..ac2a025205 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/messagerequests/MessageRequestsActivity.kt @@ -49,7 +49,7 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat adapter.glide = glide binding.recyclerView.adapter = adapter - binding.clearAllMessageRequestsButton.setOnClickListener { deleteAllAndBlock() } + binding.clearAllMessageRequestsButton.setOnClickListener { deleteAll() } } override fun onResume() { @@ -113,11 +113,11 @@ class MessageRequestsActivity : PassphraseRequiredActionBarActivity(), Conversat binding.clearAllMessageRequestsButton.isVisible = threadCount != 0 } - private fun deleteAllAndBlock() { + private fun deleteAll() { val dialog = AlertDialog.Builder(this) dialog.setMessage(resources.getString(R.string.message_requests_clear_all_message)) dialog.setPositiveButton(R.string.yes) { _, _ -> - viewModel.clearAllMessageRequests(true) + viewModel.clearAllMessageRequests(false) LoaderManager.getInstance(this).restartLoader(0, null, this) lifecycleScope.launch(Dispatchers.IO) { ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(this@MessageRequestsActivity) diff --git a/app/src/main/java/org/thoughtcrime/securesms/repository/ConversationRepository.kt b/app/src/main/java/org/thoughtcrime/securesms/repository/ConversationRepository.kt index 9d8f411401..76a9039e71 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/repository/ConversationRepository.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/repository/ConversationRepository.kt @@ -270,7 +270,7 @@ class DefaultConversationRepository @Inject constructor( while (reader.next != null) { deleteMessageRequest(reader.current) val recipient = reader.current.recipient - if (block && !recipient.isOpenGroupInboxRecipient) { + if (block) { setBlocked(recipient, true) } }