mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
fix: prevent block of users in delete all
This commit is contained in:
parent
8f51304ec1
commit
9646ea580f
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user