|
|
@ -3161,9 +3161,14 @@ class Core {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (Address address : addresses) {
|
|
|
|
for (Address address : addresses) {
|
|
|
|
final String email = ((InternetAddress) address).getAddress();
|
|
|
|
String email = ((InternetAddress) address).getAddress();
|
|
|
|
final String name = ((InternetAddress) address).getPersonal();
|
|
|
|
String name = ((InternetAddress) address).getPersonal();
|
|
|
|
final Uri avatar = ContactInfo.getLookupUri(new Address[]{address});
|
|
|
|
Uri avatar = ContactInfo.getLookupUri(new Address[]{address});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(email))
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (TextUtils.isEmpty(name))
|
|
|
|
|
|
|
|
name = null;
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
db.beginTransaction();
|
|
|
|
db.beginTransaction();
|
|
|
@ -3182,7 +3187,7 @@ class Core {
|
|
|
|
contact.id = db.contact().insertContact(contact);
|
|
|
|
contact.id = db.contact().insertContact(contact);
|
|
|
|
Log.i("Inserted contact=" + contact + " type=" + type);
|
|
|
|
Log.i("Inserted contact=" + contact + " type=" + type);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (contact.name == null && !TextUtils.isEmpty(name))
|
|
|
|
if (contact.name == null && name != null)
|
|
|
|
contact.name = name;
|
|
|
|
contact.name = name;
|
|
|
|
contact.avatar = (avatar == null ? null : avatar.toString());
|
|
|
|
contact.avatar = (avatar == null ? null : avatar.toString());
|
|
|
|
contact.times_contacted++;
|
|
|
|
contact.times_contacted++;
|
|
|
|