mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
refactor: trying to just include blocked status for now in updating contacts
This commit is contained in:
parent
8a000fe5a9
commit
b3ae2e967f
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user