Fixing Outlook sending issue.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user