Show "You" for active account in mail rendering page (#566)

* Added account contact view model to handle "You" case.

* fix namespaces again
This commit is contained in:
Aleh Khantsevich
2025-02-16 14:38:53 +01:00
committed by GitHub
parent f7836eedce
commit caae751698
9 changed files with 387 additions and 362 deletions

View File

@@ -36,14 +36,6 @@ public class AccountContact : IEquatable<AccountContact>
/// </summary>
public bool IsRootContact { get; set; }
/// <summary>
/// Short display name of the contact.
/// Eather Name or Address.
/// </summary>
public string ShortDisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? $"{Address.ToLowerInvariant()};" : $"{Name};";
public string DisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? Address.ToLowerInvariant() : $"{Name} <{Address.ToLowerInvariant()}>";
public override bool Equals(object obj)
{
return Equals(obj as AccountContact);
@@ -58,10 +50,7 @@ public class AccountContact : IEquatable<AccountContact>
public override int GetHashCode()
{
int hashCode = -1717786383;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Address);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);
return hashCode;
return HashCode.Combine(Address, Name);
}
public static bool operator ==(AccountContact left, AccountContact right)

View File

@@ -15,6 +15,7 @@
"AccountSettingsDialog_AccountName": "Sender Display Name",
"AccountSettingsDialog_AccountNamePlaceholder": "eg. John Doe",
"AddHyperlink": "Add",
"AccountContactNameYou": "You",
"AutoDiscoveryProgressMessage": "Searching for mail settings...",
"AppCloseBackgroundSynchronizationWarningTitle": "Background Synchronization",
"AppCloseTerminateBehaviorWarningMessageFirstLine": "You are terminating Wino Mail and your app close behavior is set to 'Terminate'.",