Add ContactDiscovery abstraction for doing CDS refreshes.

This commit is contained in:
Greyson Parrelli
2022-03-18 13:33:23 -04:00
parent 3c2bd032ba
commit 83c3b16b92
18 changed files with 87 additions and 46 deletions

View File

@@ -10,7 +10,7 @@ import org.signal.core.util.concurrent.SignalExecutors
import org.signal.core.util.logging.Log
import org.signal.storageservice.protos.groups.local.DecryptedGroup
import org.signal.storageservice.protos.groups.local.DecryptedPendingMember
import org.thoughtcrime.securesms.contacts.sync.DirectoryHelper
import org.thoughtcrime.securesms.contacts.sync.ContactDiscovery
import org.thoughtcrime.securesms.database.GroupDatabase
import org.thoughtcrime.securesms.database.MediaDatabase
import org.thoughtcrime.securesms.database.SignalDatabase
@@ -114,7 +114,7 @@ class ConversationSettingsRepository(
fun refreshRecipient(recipientId: RecipientId) {
SignalExecutors.UNBOUNDED.execute {
try {
DirectoryHelper.refreshDirectoryFor(context, Recipient.resolved(recipientId), false)
ContactDiscovery.refresh(context, Recipient.resolved(recipientId), false)
} catch (e: IOException) {
Log.w(TAG, "Failed to refresh user after adding to contacts.")
}