mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Prevent empty person names
This commit is contained in:
parent
542c2ade73
commit
87b5ccb5b9
1 changed files with 11 additions and 4 deletions
|
@ -3800,10 +3800,17 @@ class Core {
|
|||
|
||||
if (notify_messaging) {
|
||||
// https://developer.android.com/training/cars/messaging
|
||||
Person.Builder me = new Person.Builder()
|
||||
.setName(MessageHelper.formatAddresses(message.to, name_email, false));
|
||||
Person.Builder you = new Person.Builder()
|
||||
.setName(MessageHelper.formatAddresses(message.from, name_email, false));
|
||||
String meName = MessageHelper.formatAddresses(message.to, name_email, false);
|
||||
String youName = MessageHelper.formatAddresses(message.from, name_email, false);
|
||||
|
||||
// Names cannot be empty
|
||||
if (TextUtils.isEmpty(meName))
|
||||
meName = "-";
|
||||
if (TextUtils.isEmpty(youName))
|
||||
youName = "-";
|
||||
|
||||
Person.Builder me = new Person.Builder().setName(meName);
|
||||
Person.Builder you = new Person.Builder().setName(youName);
|
||||
|
||||
if (info[0].hasPhoto())
|
||||
you.setIcon(IconCompat.createWithBitmap(info[0].getPhotoBitmap()));
|
||||
|
|
Loading…
Reference in a new issue