Merge pull request #282 from Aga-C/fixed-private-contacts-autocomplete
Fixed private contacts not showing in group autocomplete
This commit is contained in:
commit
527b33e03d
|
@ -231,6 +231,8 @@ class ThreadActivity : SimpleActivity() {
|
||||||
private fun setupThread() {
|
private fun setupThread() {
|
||||||
val privateCursor = getMyContactsCursor(false, true)?.loadInBackground()
|
val privateCursor = getMyContactsCursor(false, true)?.loadInBackground()
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
|
privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)
|
||||||
|
|
||||||
val cachedMessagesCode = messages.clone().hashCode()
|
val cachedMessagesCode = messages.clone().hashCode()
|
||||||
messages = getMessages(threadId)
|
messages = getMessages(threadId)
|
||||||
|
|
||||||
|
@ -240,6 +242,7 @@ class ThreadActivity : SimpleActivity() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (participants.isNotEmpty() && messages.hashCode() == cachedMessagesCode && !hasParticipantWithoutName) {
|
if (participants.isNotEmpty() && messages.hashCode() == cachedMessagesCode && !hasParticipantWithoutName) {
|
||||||
|
setupAdapter()
|
||||||
return@ensureBackgroundThread
|
return@ensureBackgroundThread
|
||||||
}
|
}
|
||||||
} catch (ignored: Exception) {
|
} catch (ignored: Exception) {
|
||||||
|
@ -248,7 +251,6 @@ class ThreadActivity : SimpleActivity() {
|
||||||
setupParticipants()
|
setupParticipants()
|
||||||
|
|
||||||
// check if no participant came from a privately stored contact in Simple Contacts
|
// check if no participant came from a privately stored contact in Simple Contacts
|
||||||
privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)
|
|
||||||
if (privateContacts.isNotEmpty()) {
|
if (privateContacts.isNotEmpty()) {
|
||||||
val senderNumbersToReplace = HashMap<String, String>()
|
val senderNumbersToReplace = HashMap<String, String>()
|
||||||
participants.filter { it.doesHavePhoneNumber(it.name) }.forEach { participant ->
|
participants.filter { it.doesHavePhoneNumber(it.name) }.forEach { participant ->
|
||||||
|
|
Loading…
Reference in New Issue