diff --git a/Wino.Core.Domain/Entities/Mail/MailCopy.cs b/Wino.Core.Domain/Entities/Mail/MailCopy.cs
index 845b843d..e8082268 100644
--- a/Wino.Core.Domain/Entities/Mail/MailCopy.cs
+++ b/Wino.Core.Domain/Entities/Mail/MailCopy.cs
@@ -92,6 +92,11 @@ public class MailCopy
///
public bool IsFlagged { get; set; }
+ ///
+ /// Whether this mail should stay pinned to the top locally.
+ ///
+ public bool IsPinned { get; set; }
+
///
/// To support Outlook.
/// Gmail doesn't use it.
diff --git a/Wino.Core.Domain/Enums/MailCopyChangeFlags.cs b/Wino.Core.Domain/Enums/MailCopyChangeFlags.cs
index a6dea93f..0ceaddfb 100644
--- a/Wino.Core.Domain/Enums/MailCopyChangeFlags.cs
+++ b/Wino.Core.Domain/Enums/MailCopyChangeFlags.cs
@@ -20,17 +20,18 @@ public enum MailCopyChangeFlags
Importance = 1 << 11,
IsRead = 1 << 12,
IsFlagged = 1 << 13,
- IsFocused = 1 << 14,
- HasAttachments = 1 << 15,
- ItemType = 1 << 16,
- DraftId = 1 << 17,
- IsDraft = 1 << 18,
- FileId = 1 << 19,
- AssignedFolder = 1 << 20,
- AssignedAccount = 1 << 21,
- SenderContact = 1 << 22,
- UniqueId = 1 << 23,
- ReadReceiptState = 1 << 24,
+ IsPinned = 1 << 14,
+ IsFocused = 1 << 15,
+ HasAttachments = 1 << 16,
+ ItemType = 1 << 17,
+ DraftId = 1 << 18,
+ IsDraft = 1 << 19,
+ FileId = 1 << 20,
+ AssignedFolder = 1 << 21,
+ AssignedAccount = 1 << 22,
+ SenderContact = 1 << 23,
+ UniqueId = 1 << 24,
+ ReadReceiptState = 1 << 25,
All = Id |
FolderId |
ThreadId |
@@ -45,6 +46,7 @@ public enum MailCopyChangeFlags
Importance |
IsRead |
IsFlagged |
+ IsPinned |
IsFocused |
HasAttachments |
ItemType |
diff --git a/Wino.Core.Domain/Interfaces/IMailListItemSorting.cs b/Wino.Core.Domain/Interfaces/IMailListItemSorting.cs
index 5d4c24f5..d9884992 100644
--- a/Wino.Core.Domain/Interfaces/IMailListItemSorting.cs
+++ b/Wino.Core.Domain/Interfaces/IMailListItemSorting.cs
@@ -6,4 +6,5 @@ public interface IMailListItemSorting
{
DateTime SortingDate { get; }
string SortingName { get; }
+ bool IsPinned { get; }
}
diff --git a/Wino.Core.Domain/Interfaces/IMailService.cs b/Wino.Core.Domain/Interfaces/IMailService.cs
index 5afdb5b6..5b4d4420 100644
--- a/Wino.Core.Domain/Interfaces/IMailService.cs
+++ b/Wino.Core.Domain/Interfaces/IMailService.cs
@@ -26,6 +26,7 @@ public interface IMailService
///
Task> GetMailItemsAsync(IEnumerable mailCopyIds);
Task> FetchMailsAsync(MailListInitializationOptions options, CancellationToken cancellationToken = default);
+ Task> FetchPinnedMailsAsync(MailListInitializationOptions options, CancellationToken cancellationToken = default);
///
/// Deletes all mail copies for all folders.
@@ -36,6 +37,7 @@ public interface IMailService
Task ChangeReadStatusAsync(string mailCopyId, bool isRead);
Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged);
+ Task ChangePinnedStatusAsync(IEnumerable uniqueMailIds, bool isPinned);
Task ApplyMailStateUpdatesAsync(IEnumerable updates);
Task CreateAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
diff --git a/Wino.Core.Domain/Models/Comparers/ListItemComparer.cs b/Wino.Core.Domain/Models/Comparers/ListItemComparer.cs
index 50aecc8a..bae0ec27 100644
--- a/Wino.Core.Domain/Models/Comparers/ListItemComparer.cs
+++ b/Wino.Core.Domain/Models/Comparers/ListItemComparer.cs
@@ -1,7 +1,8 @@
-using System;
+using System;
using System.Collections.Generic;
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Interfaces;
+using Wino.Core.Domain.Models.MailItem;
public class ListItemComparer : IComparer