Skip to content

Commit 67ab101

Browse files
authored
Merge pull request #890 from a-andre/fix_743
Fix display of names if contact contains organization data (#743)
2 parents 66d734f + 3837ffe commit 67ab101

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,14 @@ class ContactsHelper(val context: Context) {
722722
var middleName = ""
723723
var surname = ""
724724
var suffix = ""
725-
val mimetype = cursor.getStringValue(Data.MIMETYPE)
725+
var mimetype = cursor.getStringValue(Data.MIMETYPE)
726726

727+
// if first line is an Organization type contact, go to next line
728+
if (mimetype != StructuredName.CONTENT_ITEM_TYPE) {
729+
if (cursor.moveToNext()) {
730+
mimetype = cursor.getStringValue(Data.MIMETYPE)
731+
}
732+
}
727733
// ignore names at Organization type contacts
728734
if (mimetype == StructuredName.CONTENT_ITEM_TYPE) {
729735
prefix = cursor.getStringValue(StructuredName.PREFIX) ?: ""

0 commit comments

Comments
 (0)