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:
@@ -143,7 +143,7 @@ namespace Wino.Services
|
||||
if (!string.IsNullOrEmpty(unstickyItem.ParentRemoteFolderId))
|
||||
continue;
|
||||
}
|
||||
else if (account.ProviderType == MailProviderType.Outlook || account.ProviderType == MailProviderType.Office365)
|
||||
else if (account.ProviderType == MailProviderType.Outlook)
|
||||
{
|
||||
bool belongsToExistingParent = await Connection
|
||||
.Table<MailItemFolder>()
|
||||
@@ -367,16 +367,14 @@ namespace Wino.Services
|
||||
|
||||
public async Task<IList<uint>> GetKnownUidsForFolderAsync(Guid folderId)
|
||||
{
|
||||
var folder = await GetFolderAsync(folderId);
|
||||
|
||||
if (folder == null) return default;
|
||||
|
||||
var mailCopyIds = await GetMailCopyIdsByFolderIdAsync(folderId);
|
||||
|
||||
// Make sure we don't include Ids that doesn't have uid separator.
|
||||
// Local drafts might not have it for example.
|
||||
|
||||
return new List<uint>(mailCopyIds.Where(a => a.Contains(MailkitClientExtensions.MailCopyUidSeparator)).Select(a => MailkitClientExtensions.ResolveUid(a)));
|
||||
return new List<uint>(mailCopyIds
|
||||
.Where(a => a.Contains(MailkitClientExtensions.MailCopyUidSeparator))
|
||||
.Select(a => MailkitClientExtensions.ResolveUid(a)));
|
||||
}
|
||||
|
||||
public async Task<MailAccount> UpdateSystemFolderConfigurationAsync(Guid accountId, SystemFolderConfiguration configuration)
|
||||
@@ -546,7 +544,19 @@ namespace Wino.Services
|
||||
{
|
||||
var folders = new List<MailItemFolder>();
|
||||
|
||||
if (options.Type == MailSynchronizationType.FullFolders)
|
||||
if (options.Type == MailSynchronizationType.IMAPIdle)
|
||||
{
|
||||
// Type Inbox will include Sent, Drafts and Deleted folders as well.
|
||||
// For IMAP idle sync, we must include only Inbox folder.
|
||||
|
||||
var inboxFolder = await GetSpecialFolderByAccountIdAsync(options.AccountId, SpecialFolderType.Inbox);
|
||||
|
||||
if (inboxFolder != null)
|
||||
{
|
||||
folders.Add(inboxFolder);
|
||||
}
|
||||
}
|
||||
else if (options.Type == MailSynchronizationType.FullFolders)
|
||||
{
|
||||
// Only get sync enabled folders.
|
||||
|
||||
@@ -570,12 +580,19 @@ namespace Wino.Services
|
||||
}
|
||||
else if (options.Type == MailSynchronizationType.CustomFolders)
|
||||
{
|
||||
// Only get the specified and enabled folders.
|
||||
// Only get the specified folders.
|
||||
|
||||
var synchronizationFolders = await Connection.Table<MailItemFolder>()
|
||||
.Where(a => a.MailAccountId == options.AccountId && options.SynchronizationFolderIds.Contains(a.Id))
|
||||
.Where(a =>
|
||||
a.MailAccountId == options.AccountId &&
|
||||
options.SynchronizationFolderIds.Contains(a.Id))
|
||||
.ToListAsync();
|
||||
|
||||
if (options.ExcludeMustHaveFolders)
|
||||
{
|
||||
return synchronizationFolders;
|
||||
}
|
||||
|
||||
// Order is important for moving.
|
||||
// By implementation, removing mail folders must be synchronized first. Requests are made in that order for custom sync.
|
||||
// eg. Moving item from Folder A to Folder B. If we start syncing Folder B first, we might miss adding assignment for Folder A.
|
||||
|
||||
Reference in New Issue
Block a user