Ensure Geary.Contact real names are distinct from their address
This avoids presenting contacts as "name@example.com" <name@example.com>
This commit is contained in:
parent
91caff487b
commit
96cbb83f83
1 changed files with 9 additions and 2 deletions
|
|
@ -72,13 +72,20 @@ public class Geary.Contact : BaseObject {
|
|||
string? normalized_email = null) {
|
||||
this.normalized_email = normalized_email ?? email.normalize().casefold();
|
||||
this.email = email;
|
||||
this.real_name = real_name;
|
||||
this.real_name = (
|
||||
(real_name != email && real_name != normalized_email)
|
||||
? real_name : null
|
||||
);
|
||||
this.highest_importance = highest_importance;
|
||||
}
|
||||
|
||||
public Contact.from_rfc822_address(RFC822.MailboxAddress address,
|
||||
int highest_importance) {
|
||||
this(address.address, address.name, highest_importance);
|
||||
this(
|
||||
address.address,
|
||||
address.has_distinct_name() ? address.name : null,
|
||||
highest_importance
|
||||
);
|
||||
}
|
||||
|
||||
public RFC822.MailboxAddress get_rfc822_address() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue