Mail: Avoid showing contacts' empty addresses

Other contacts apps like Peeps! allow for more than one email
addresses, using the attributes META:email{n} with n >=2.
Only, not all contacts having those additional attributes have
them actually filled.

This results duplicate entries in e.g. the To-field pop-up with
no email address attached.

We now only add an item if its email address isn't empty for those
additional email attributes as well.

Change-Id: Icb1750fe8e2b10280bc01b3181b444f01096e021
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9329
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Humdinger
2025-06-07 13:19:05 +00:00
committed by waddlesplash
parent 6d052afc3f
commit 1ebc7b923c
+1 -1
View File
@@ -36,7 +36,7 @@ AddPersonAddresses(BNode& node, BStringList& addresses)
char attr[32];
snprintf(attr, sizeof(attr), "META:email%d", i);
if (node.ReadAttrString(attr, &email) != B_OK)
if (node.ReadAttrString(attr, &email) != B_OK || email.IsEmpty())
break;
addresses.Add(email);