2024-08-15 16:02:02 +02:00
|
|
|
|
using System;
|
2024-08-16 01:29:31 +02:00
|
|
|
|
using System.Collections.Generic;
|
2024-08-15 16:02:02 +02:00
|
|
|
|
using SQLite;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Wino.Core.Domain.Entities
|
|
|
|
|
|
{
|
|
|
|
|
|
public class MailAccountAlias
|
|
|
|
|
|
{
|
2024-08-15 16:13:18 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Unique Id for the alias.
|
|
|
|
|
|
/// </summary>
|
2024-08-15 16:02:02 +02:00
|
|
|
|
[PrimaryKey]
|
|
|
|
|
|
public Guid Id { get; set; }
|
2024-08-15 16:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Account id that this alias is attached to.
|
|
|
|
|
|
/// </summary>
|
2024-08-15 16:02:02 +02:00
|
|
|
|
public Guid AccountId { get; set; }
|
2024-08-15 16:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Display address of the alias.
|
|
|
|
|
|
/// </summary>
|
2024-08-15 16:02:02 +02:00
|
|
|
|
public string AliasAddress { get; set; }
|
2024-08-15 16:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Address to be included in Reply-To header when alias is used for sending messages.
|
|
|
|
|
|
/// </summary>
|
2024-08-15 16:11:12 +02:00
|
|
|
|
public string ReplyToAddress { get; set; }
|
2024-08-15 16:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether this alias is the primary alias for the account.
|
|
|
|
|
|
/// </summary>
|
2024-08-15 16:02:02 +02:00
|
|
|
|
public bool IsPrimary { get; set; }
|
2024-08-15 16:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether the alias is verified by the server.
|
|
|
|
|
|
/// Non-verified aliases will show an info tip to users during sending.
|
|
|
|
|
|
/// Only Gmail aliases are verified for now.
|
|
|
|
|
|
/// Non-verified alias messages might be rejected by SMTP server.
|
|
|
|
|
|
/// </summary>
|
2024-08-15 16:02:02 +02:00
|
|
|
|
public bool IsVerified { get; set; }
|
2024-08-16 01:29:31 +02:00
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (obj == null || GetType() != obj.GetType())
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
var other = (MailAccountAlias)obj;
|
|
|
|
|
|
return other != null &&
|
|
|
|
|
|
AccountId == other.AccountId &&
|
|
|
|
|
|
AliasAddress == other.AliasAddress &&
|
|
|
|
|
|
ReplyToAddress == other.ReplyToAddress &&
|
|
|
|
|
|
IsPrimary == other.IsPrimary &&
|
|
|
|
|
|
IsVerified == other.IsVerified;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
|
{
|
|
|
|
|
|
int hashCode = -753829106;
|
|
|
|
|
|
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 + IsVerified.GetHashCode();
|
|
|
|
|
|
return hashCode;
|
|
|
|
|
|
}
|
2024-08-15 16:02:02 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|