Merge pull request #890 from a-andre/fix_743

Fix display of names if contact contains organization data (#743)
This commit is contained in:
Tibor Kaputa 2023-01-04 20:05:27 +01:00 committed by GitHub
commit 67ab10186d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -722,8 +722,14 @@ class ContactsHelper(val context: Context) {
var middleName = ""
var surname = ""
var suffix = ""
val mimetype = cursor.getStringValue(Data.MIMETYPE)
var mimetype = cursor.getStringValue(Data.MIMETYPE)
// if first line is an Organization type contact, go to next line
if (mimetype != StructuredName.CONTENT_ITEM_TYPE) {
if (cursor.moveToNext()) {
mimetype = cursor.getStringValue(Data.MIMETYPE)
}
}
// ignore names at Organization type contacts
if (mimetype == StructuredName.CONTENT_ITEM_TYPE) {
prefix = cursor.getStringValue(StructuredName.PREFIX) ?: ""