fix #254, if there is no N and ORG fields at the given contact, only FN, treat it as an organization

This commit is contained in:
tibbi 2018-09-27 12:16:39 +02:00
parent 11349a3112
commit 12c5f52092
1 changed files with 5 additions and 0 deletions

View File

@ -138,6 +138,11 @@ class VcfImporter(val activity: SimpleActivity) {
val contact = Contact(0, prefix, firstName, middleName, surname, suffix, nickname, photoUri, phoneNumbers, emails, addresses, events,
targetContactSource, starred, contactId, thumbnailUri, photo, notes, groups, organization, websites, cleanPhoneNumbers, IMs)
// if there is no N and ORG fields at the given contact, only FN, treat it as an organization
if (contact.getFullName().isEmpty() && contact.organization.isEmpty() && ezContact.formattedName.value.isNotEmpty()) {
contact.organization.company = ezContact.formattedName.value
}
if (ContactsHelper(activity).insertContact(contact)) {
contactsImported++
}