Download messages in ascending order.

This commit is contained in:
Burak Kaan Köse
2025-02-26 11:45:23 +01:00
parent 832b363da7
commit e8142ff3df
2 changed files with 7 additions and 3 deletions

View File

@@ -42,7 +42,10 @@ public abstract class ImapSynchronizationStrategyBase : IImapSynchronizerStrateg
public abstract Task<List<string>> HandleSynchronizationAsync(IImapClient client, MailItemFolder folder, IImapSynchronizer synchronizer, CancellationToken cancellationToken = default);
internal abstract Task<IList<UniqueId>> GetChangedUidsAsync(IImapClient client, IMailFolder remoteFolder, IImapSynchronizer synchronizer, CancellationToken cancellationToken = default);
protected async Task<List<string>> HandleChangedUIdsAsync(IImapSynchronizer synchronizer, IMailFolder remoteFolder, IList<UniqueId> changedUids, CancellationToken cancellationToken)
protected async Task<List<string>> HandleChangedUIdsAsync(IImapSynchronizer synchronizer,
IMailFolder remoteFolder,
IList<UniqueId> changedUids,
CancellationToken cancellationToken)
{
List<string> downloadedMessageIds = new();
@@ -88,7 +91,8 @@ public abstract class ImapSynchronizationStrategyBase : IImapSynchronizerStrateg
foreach (var group in batchedMessageIds)
{
downloadedMessageIds.AddRange(group.Select(a => MailkitClientExtensions.CreateUid(Folder.Id, a.Id)));
await DownloadMessagesAsync(synchronizer, remoteFolder, Folder, new UniqueIdSet(group), cancellationToken).ConfigureAwait(false);
await DownloadMessagesAsync(synchronizer, remoteFolder, Folder, new UniqueIdSet(group, SortOrder.Ascending), cancellationToken).ConfigureAwait(false);
}
return downloadedMessageIds;

View File

@@ -12,7 +12,7 @@
<Identity
Name="58272BurakKSE.WinoMailPreview"
Publisher="CN=51FBDAF3-E212-4149-89A2-A2636B3BC911"
Version="1.10.0.0" />
Version="1.10.2.0" />
<Extensions>
<!-- Publisher Cache Folders -->