mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 02:55:23 +00:00
SES-2810 - Catering for missing config contacts vs local contacts
Making sure we deleted conversations when a contact is missing from the config while existing locally
This commit is contained in:
parent
bc53bcab38
commit
e8b3399ee0
@ -1265,6 +1265,16 @@ open class Storage(
|
|||||||
}
|
}
|
||||||
setRecipientHash(recipient, contact.hashCode().toString())
|
setRecipientHash(recipient, contact.hashCode().toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we have contacts locally but that are missing from the config, remove their corresponding thread
|
||||||
|
val removedContacts = getAllContacts().filter { localContact ->
|
||||||
|
moreContacts.firstOrNull {
|
||||||
|
it.id == localContact.accountID
|
||||||
|
} == null
|
||||||
|
}
|
||||||
|
removedContacts.forEach {
|
||||||
|
getThreadId(fromSerialized(it.accountID))?.let(::deleteConversation)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun addContacts(contacts: List<ConfigurationMessage.Contact>) {
|
override fun addContacts(contacts: List<ConfigurationMessage.Contact>) {
|
||||||
|
Loading…
Reference in New Issue
Block a user