Managing account aliases and profile synchronization for outlook and gmail.

This commit is contained in:
Burak Kaan Köse
2024-08-17 03:43:37 +02:00
parent f1154058ba
commit abff850427
46 changed files with 949 additions and 272 deletions

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using SQLite;
using Wino.Core.Domain.Enums;
@@ -48,7 +47,7 @@ namespace Wino.Core.Domain.Entities
/// <summary>
/// Base64 encoded profile picture of the account.
/// </summary>
public string ProfilePictureBase64 { get; set; }
public string Base64ProfilePictureData { get; set; }
/// <summary>
/// Gets or sets the listing order of the account in the accounts list.
@@ -84,8 +83,8 @@ namespace Wino.Core.Domain.Entities
/// It's only synchronized for Gmail right now.
/// Other provider types are manually added by users and not verified.
/// </summary>
[Ignore]
public List<MailAccountAlias> Aliases { get; set; }
//[Ignore]
//public List<MailAccountAlias> Aliases { get; set; }
/// <summary>
/// Account preferences.

View File

@@ -32,6 +32,13 @@ namespace Wino.Core.Domain.Entities
/// </summary>
public bool IsPrimary { get; set; }
/// <summary>
/// Whether this alias is the root alias for the account.
/// Root alias means the first alias that was created for the account.
/// It can't be deleted or changed.
/// </summary>
public bool IsRootAlias { get; set; }
/// <summary>
/// Whether the alias is verified by the server.
/// Non-verified aliases will show an info tip to users during sending.
@@ -40,6 +47,11 @@ namespace Wino.Core.Domain.Entities
/// </summary>
public bool IsVerified { get; set; }
/// <summary>
/// Root aliases can't be deleted.
/// </summary>
public bool CanDelete => !IsRootAlias;
public override bool Equals(object obj)
{
if (obj == null || GetType() != obj.GetType())
@@ -51,17 +63,20 @@ namespace Wino.Core.Domain.Entities
AliasAddress == other.AliasAddress &&
ReplyToAddress == other.ReplyToAddress &&
IsPrimary == other.IsPrimary &&
IsVerified == other.IsVerified;
IsVerified == other.IsVerified &&
IsRootAlias == other.IsRootAlias;
}
public override int GetHashCode()
{
int hashCode = -753829106;
int hashCode = 59052167;
hashCode = hashCode * -1521134295 + AccountId.GetHashCode();
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(AliasAddress);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(ReplyToAddress);
hashCode = hashCode * -1521134295 + IsPrimary.GetHashCode();
hashCode = hashCode * -1521134295 + IsRootAlias.GetHashCode();
hashCode = hashCode * -1521134295 + IsVerified.GetHashCode();
hashCode = hashCode * -1521134295 + CanDelete.GetHashCode();
return hashCode;
}
}