refactor: trying to just include blocked status for now in updating contacts

This commit is contained in:
0x330a 2023-02-23 17:42:59 +11:00
parent 8a000fe5a9
commit b3ae2e967f
No known key found for this signature in database
GPG Key ID: 267811D6E6A2698C

View File

@ -336,16 +336,9 @@ class Storage(context: Context, helper: SQLCipherOpenHelper, private val configF
private fun updateContacts(contacts: Contacts) { private fun updateContacts(contacts: Contacts) {
val extracted = contacts.all().toList() val extracted = contacts.all().toList()
extracted.forEach { contact -> extracted.forEach { contact ->
val address = Address.fromSerialized(contact.id) val address = fromSerialized(contact.id)
val settings = getRecipientSettings(address) ?: run { val recipient = Recipient.from(context, address, false)
// new contact, store it setBlocked(listOf(recipient), contact.blocked)
}
contact.name
contact.approved
contact.approvedMe
contact.blocked
contact.nickname
contact.profilePicture
} }
} }
@ -1142,7 +1135,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper, private val configF
} }
val contactsConfig = configFactory.contacts ?: return val contactsConfig = configFactory.contacts ?: return
if (contactsConfig.needsDump()) { if (contactsConfig.needsDump()) {
configFactory.persist(contactsConfig)
ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(context) ConfigurationMessageUtilities.forceSyncConfigurationNowIfNeeded(context)
} }
} }