IMAP Improvements (#558)
* Fixing an issue where scrollviewer overrides a part of template in mail list. Adjusted zoomed out header grid's corner radius. * IDLE implementation, imap synchronization strategies basics and condstore synchronization. * Adding iCloud and Yahoo as special IMAP handling scenario. * iCloud special imap handling. * Support for killing synchronizers. * Update privacy policy url. * Batching condstore downloads into 50, using SORT extension for searches if supported. * Bumping some nugets. More on the imap synchronizers. * Delegating idle synchronizations to server to post-sync operations. * Update mailkit to resolve qresync bug with iCloud. * Fixing remote highest mode seq checks for qresync and condstore synchronizers. * Yahoo custom settings. * Bump google sdk package. * Fixing the build issue.... * NRE on canceled token accounts during setup. * Server crash handlers. * Remove ARM32. Upgrade server to .NET 9. * Fix icons for yahoo and apple. * Fixed an issue where disabled folders causing an exception on forced sync. * Remove smtp encoding constraint. * Remove commented code. * Fixing merge conflict * Addressing double registrations for mailkit remote folder events in synchronizers. * Making sure idle canceled result is not reported. * Fixing custom imap server dialog opening. * Fixing the issue with account creation making the previously selected account as selected as well. * Fixing app close behavior and logging app close.
This commit is contained in:
@@ -28,7 +28,6 @@ namespace Wino.Core.Services
|
||||
return providerType switch
|
||||
{
|
||||
MailProviderType.Outlook => new OutlookAuthenticator(_nativeAppService, _applicationConfiguration, _authenticatorConfig),
|
||||
MailProviderType.Office365 => new Office365Authenticator(_nativeAppService, _applicationConfiguration, _authenticatorConfig),
|
||||
MailProviderType.Gmail => new GmailAuthenticator(_authenticatorConfig),
|
||||
_ => throw new ArgumentException(Translator.Exception_UnsupportedProvider),
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ namespace Wino.Core.Services
|
||||
private bool isInitialized = false;
|
||||
|
||||
private readonly IAccountService _accountService;
|
||||
private readonly IImapSynchronizationStrategyProvider _imapSynchronizationStrategyProvider;
|
||||
private readonly IApplicationConfiguration _applicationConfiguration;
|
||||
private readonly IOutlookChangeProcessor _outlookChangeProcessor;
|
||||
private readonly IGmailChangeProcessor _gmailChangeProcessor;
|
||||
@@ -28,6 +29,7 @@ namespace Wino.Core.Services
|
||||
IOutlookAuthenticator outlookAuthenticator,
|
||||
IGmailAuthenticator gmailAuthenticator,
|
||||
IAccountService accountService,
|
||||
IImapSynchronizationStrategyProvider imapSynchronizationStrategyProvider,
|
||||
IApplicationConfiguration applicationConfiguration)
|
||||
{
|
||||
_outlookChangeProcessor = outlookChangeProcessor;
|
||||
@@ -36,6 +38,7 @@ namespace Wino.Core.Services
|
||||
_outlookAuthenticator = outlookAuthenticator;
|
||||
_gmailAuthenticator = gmailAuthenticator;
|
||||
_accountService = accountService;
|
||||
_imapSynchronizationStrategyProvider = imapSynchronizationStrategyProvider;
|
||||
_applicationConfiguration = applicationConfiguration;
|
||||
}
|
||||
|
||||
@@ -51,6 +54,7 @@ namespace Wino.Core.Services
|
||||
{
|
||||
synchronizer = CreateNewSynchronizer(account);
|
||||
|
||||
|
||||
return await GetAccountSynchronizerAsync(accountId);
|
||||
}
|
||||
}
|
||||
@@ -65,12 +69,11 @@ namespace Wino.Core.Services
|
||||
switch (providerType)
|
||||
{
|
||||
case Domain.Enums.MailProviderType.Outlook:
|
||||
case Domain.Enums.MailProviderType.Office365:
|
||||
return new OutlookSynchronizer(mailAccount, _outlookAuthenticator, _outlookChangeProcessor);
|
||||
case Domain.Enums.MailProviderType.Gmail:
|
||||
return new GmailSynchronizer(mailAccount, _gmailAuthenticator, _gmailChangeProcessor);
|
||||
case Domain.Enums.MailProviderType.IMAP4:
|
||||
return new ImapSynchronizer(mailAccount, _imapChangeProcessor, _applicationConfiguration);
|
||||
return new ImapSynchronizer(mailAccount, _imapChangeProcessor, _imapSynchronizationStrategyProvider, _applicationConfiguration);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -82,6 +85,12 @@ namespace Wino.Core.Services
|
||||
{
|
||||
var synchronizer = CreateIntegratorWithDefaultProcessor(account);
|
||||
|
||||
if (synchronizer is IImapSynchronizer imapSynchronizer)
|
||||
{
|
||||
// Start the idle client for IMAP synchronizer.
|
||||
_ = imapSynchronizer.StartIdleClientAsync();
|
||||
}
|
||||
|
||||
synchronizerCache.Add(synchronizer);
|
||||
|
||||
return synchronizer;
|
||||
@@ -100,5 +109,18 @@ namespace Wino.Core.Services
|
||||
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
public async Task DeleteSynchronizerAsync(Guid accountId)
|
||||
{
|
||||
var synchronizer = synchronizerCache.Find(a => a.Account.Id == accountId);
|
||||
|
||||
if (synchronizer != null)
|
||||
{
|
||||
// Stop the current synchronization.
|
||||
await synchronizer.KillSynchronizerAsync();
|
||||
|
||||
synchronizerCache.Remove(synchronizer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Wino.Core.Services
|
||||
{
|
||||
return mailProviderType switch
|
||||
{
|
||||
MailProviderType.Outlook or MailProviderType.Office365 => _outlookThreadingStrategy,
|
||||
MailProviderType.Outlook => _outlookThreadingStrategy,
|
||||
MailProviderType.Gmail => _gmailThreadingStrategy,
|
||||
_ => _imapThreadStrategy,
|
||||
};
|
||||
|
||||
@@ -163,8 +163,7 @@ namespace Wino.Core.Services
|
||||
MailItemFolder archiveFolder = null;
|
||||
|
||||
bool shouldRequireArchiveFolder = mailItem.AssignedAccount.ProviderType == MailProviderType.Outlook
|
||||
|| mailItem.AssignedAccount.ProviderType == MailProviderType.IMAP4
|
||||
|| mailItem.AssignedAccount.ProviderType == MailProviderType.Office365;
|
||||
|| mailItem.AssignedAccount.ProviderType == MailProviderType.IMAP4;
|
||||
|
||||
if (shouldRequireArchiveFolder)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user