From b3ae2e967fdeeb63cff3ececda6918617b5d0531 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Thu, 23 Feb 2023 17:42:59 +1100 Subject: [PATCH] refactor: trying to just include blocked status for now in updating contacts --- .../org/thoughtcrime/securesms/database/Storage.kt | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt index dcf956e48d..3875a0fffb 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -336,16 +336,9 @@ class Storage(context: Context, helper: SQLCipherOpenHelper, private val configF private fun updateContacts(contacts: Contacts) { val extracted = contacts.all().toList() extracted.forEach { contact -> - val address = Address.fromSerialized(contact.id) - val settings = getRecipientSettings(address) ?: run { - // new contact, store it - } - contact.name - contact.approved - contact.approvedMe - contact.blocked - contact.nickname - contact.profilePicture + val address = fromSerialized(contact.id) + val recipient = Recipient.from(context, address, false) + setBlocked(listOf(recipient), contact.blocked) } } @@ -1142,7 +1135,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper, private val configF } val contactsConfig = configFactory.contacts ?: return if (contactsConfig.needsDump()) { - configFactory.persist(contactsConfig) ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(context) } }