Bunch of improvements i dunno.

This commit is contained in:
Burak Kaan Köse
2025-10-31 00:51:27 +01:00
parent 2d81d07c0a
commit 4bf8f8b3d3
28 changed files with 1133 additions and 430 deletions
+13
View File
@@ -797,6 +797,9 @@ public class MailService : BaseDatabaseService, IMailService
public Task<int> GetMailItemQueueCountAsync(Guid accountId)
=> Connection.Table<MailItemQueue>().Where(a => a.AccountId == accountId).CountAsync();
public Task<int> GetMailItemQueueCountByFolderAsync(Guid accountId, string remoteFolderId)
=> Connection.Table<MailItemQueue>().Where(a => a.AccountId == accountId && a.RemoteFolderId == remoteFolderId).CountAsync();
public Task UpdateMailItemQueueAsync(IEnumerable<MailItemQueue> queueItems)
{
if (queueItems == null || !queueItems.Any())
@@ -824,6 +827,16 @@ public class MailService : BaseDatabaseService, IMailService
.ToListAsync();
}
public Task<List<MailItemQueue>> GetMailItemQueueByFolderAsync(Guid accountId, string remoteFolderId, int take)
{
// For Outlook per-folder sync
return Connection.Table<MailItemQueue>()
.Where(a => a.AccountId == accountId && a.RemoteFolderId == remoteFolderId && !a.IsProcessed)
.OrderBy(a => a.CreatedAt)
.Take(take)
.ToListAsync();
}
#endregion
private async Task<MimeMessage> CreateDraftMimeAsync(MailAccount account, DraftCreationOptions draftCreationOptions)