fix #103, make sure private contact names are shown at group conversations
This commit is contained in:
parent
8b17b8a13e
commit
75fb84f9d4
2 changed files with 16 additions and 18 deletions
|
|
@ -185,20 +185,8 @@ class MainActivity : SimpleActivity() {
|
|||
private fun getNewConversations(cachedConversations: ArrayList<Conversation>) {
|
||||
val privateCursor = getMyContactsCursor().loadInBackground()
|
||||
ensureBackgroundThread {
|
||||
val conversations = getConversations()
|
||||
|
||||
// check if no message came from a privately stored contact in Simple Contacts
|
||||
val privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)
|
||||
if (privateContacts.isNotEmpty()) {
|
||||
conversations.filter { it.title == it.phoneNumber }.forEach { conversation ->
|
||||
privateContacts.forEach { contact ->
|
||||
if (contact.doesContainPhoneNumber(conversation.phoneNumber)) {
|
||||
conversation.title = contact.name
|
||||
conversation.photoUri = contact.photoUri
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val conversations = getConversations(privateContacts = privateContacts)
|
||||
|
||||
runOnUiThread {
|
||||
setupConversations(conversations)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue