Fixing Outlook sending issue.

This commit is contained in:
Burak Kaan Köse
2024-06-11 22:48:18 +02:00
parent 0e9fd4373e
commit e47e3d936b
3 changed files with 17 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ namespace Wino.Core.Services
{
public class MailService : BaseDatabaseService, IMailService
{
private const int ItemLoadCount = 20;
private const int ItemLoadCount = 100;
private readonly IFolderService _folderService;
private readonly IContactService _contactService;
@@ -415,6 +415,14 @@ namespace Wino.Core.Services
await Connection.DeleteAsync(mailCopy).ConfigureAwait(false);
// If there are no more copies exists of the same mail, delete the MIME file as well.
var isMailExists = await IsMailExistsAsync(mailCopy.Id).ConfigureAwait(false);
if (!isMailExists)
{
await _mimeFileService.DeleteMimeMessageAsync(mailCopy.AssignedAccount.Id, mailCopy.FileId).ConfigureAwait(false);
}
ReportUIChange(new MailRemovedMessage(mailCopy));
}

View File

@@ -148,6 +148,12 @@ namespace Wino.Core.Synchronizers
await synchronizationSemaphore.WaitAsync(activeSynchronizationCancellationToken);
// Let servers to finish their job. Sometimes the servers doesn't respond immediately.
if (options.Type == SynchronizationType.ExecuteRequests)
{
await Task.Delay(2000);
}
// Start the internal synchronization.
var synchronizationResult = await SynchronizeInternalAsync(options, activeSynchronizationCancellationToken).ConfigureAwait(false);

View File

@@ -686,7 +686,8 @@ namespace Wino.Core.Synchronizers
var mimeMessage = await DownloadMimeMessageAsync(message.Id, cancellationToken).ConfigureAwait(false);
var mailCopy = message.AsMailCopy();
if (mimeMessage.Headers.Contains(Domain.Constants.WinoLocalDraftHeader)
if (message.IsDraft.GetValueOrDefault()
&& mimeMessage.Headers.Contains(Domain.Constants.WinoLocalDraftHeader)
&& Guid.TryParse(mimeMessage.Headers[Domain.Constants.WinoLocalDraftHeader], out Guid localDraftCopyUniqueId))
{
// This message belongs to existing local draft copy.