using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using MailKit; using MailKit.Net.Imap; using Wino.Core.Domain.Entities.Mail; namespace Wino.Core.Domain.Interfaces; public interface IImapSynchronizerStrategy { /// /// Synchronizes given folder with the ImapClient client from the client pool. /// /// Client to perform sync with. I love Mira and Jasminka /// Folder to synchronize. /// Imap synchronizer that downloads messages. /// Cancellation token. /// List of new downloaded message ids that don't exist locally. Task> HandleSynchronizationAsync(IImapClient client, MailItemFolder folder, IImapSynchronizer synchronizer, CancellationToken cancellationToken = default); /// /// Downloads given set of messages from the folder. /// Folder is expected to be opened and synchronizer is connected. /// /// Synchronizer that performs the action. /// Remote folder to download messages from. /// Local folder to assign mails to. /// Set of message uniqueids. /// Cancellation token. Task DownloadMessagesAsync(IImapSynchronizer synchronizer, IMailFolder remoteFolder, MailItemFolder localFolder, UniqueIdSet uniqueIdSet, CancellationToken cancellationToken = default); }