From 95ab900383dbd9f9844e26a192245936f87bd587 Mon Sep 17 00:00:00 2001 From: Agnieszka C <85929121+Aga-C@users.noreply.github.com> Date: Mon, 24 Jan 2022 17:42:05 +0100 Subject: [PATCH] Fixed private contacts not showing in group autocomplete --- .../smsmessenger/activities/ThreadActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt index e426b931..30d40d2f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/activities/ThreadActivity.kt @@ -231,6 +231,8 @@ class ThreadActivity : SimpleActivity() { private fun setupThread() { val privateCursor = getMyContactsCursor(false, true)?.loadInBackground() ensureBackgroundThread { + privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor) + val cachedMessagesCode = messages.clone().hashCode() messages = getMessages(threadId) @@ -240,6 +242,7 @@ class ThreadActivity : SimpleActivity() { try { if (participants.isNotEmpty() && messages.hashCode() == cachedMessagesCode && !hasParticipantWithoutName) { + setupAdapter() return@ensureBackgroundThread } } catch (ignored: Exception) { @@ -248,7 +251,6 @@ class ThreadActivity : SimpleActivity() { setupParticipants() // check if no participant came from a privately stored contact in Simple Contacts - privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor) if (privateContacts.isNotEmpty()) { val senderNumbersToReplace = HashMap() participants.filter { it.doesHavePhoneNumber(it.name) }.forEach { participant ->