Merge pull request #1608

Don't try to show invalid mail addresses in recipient selector

Fixes #1607
This commit is contained in:
cketti 2016-09-13 04:16:45 +02:00
commit 521c9129a5
2 changed files with 10 additions and 4 deletions

View file

@ -238,12 +238,14 @@ public class RecipientLoader extends AsyncTaskLoader<List<Recipient>> {
}
}
Uri photoUri = cursor.isNull(INDEX_PHOTO_URI) ? null : Uri.parse(cursor.getString(INDEX_PHOTO_URI));
Recipient recipient = new Recipient(name, email, addressLabel, contactId, lookupKey);
recipient.photoThumbnailUri = photoUri;
if (recipient.isValidEmailAddress()) {
Uri photoUri = cursor.isNull(INDEX_PHOTO_URI) ? null : Uri.parse(cursor.getString(INDEX_PHOTO_URI));
recipientMap.put(email, recipient);
recipients.add(recipient);
recipient.photoThumbnailUri = photoUri;
recipientMap.put(email, recipient);
recipients.add(recipient);
}
}
cursor.close();

View file

@ -550,6 +550,10 @@ public class RecipientSelectView extends TokenCompleteTextView<Recipient> implem
return address.getAddress();
}
public boolean isValidEmailAddress() {
return (address.getAddress() != null);
}
public String getDisplayNameOrUnknown(Context context) {
String displayName = getDisplayName();
if (displayName != null) {