oc-mail: Flush IMAP hierarchy cache to update Outlook folders

This fixes two scenarios:

* An IMAP subfolder has updated its hierarchy when it is asked
  to be synchronised
* An IMAP root folder is created on Outlook when you logon. OpenChange
  changes are required to be refreshed on synchronisation.
pull/84/head
Enrique J. Hernández Blasco 2015-05-05 10:46:53 +02:00
parent dc5237e92e
commit 2d65b75b56
2 changed files with 8 additions and 0 deletions

View File

@ -146,6 +146,9 @@ MakeDisplayFolderName (NSString *folderName)
DLIST_ADD_END (firstContext, context, void);
}
/* FIXME: Flush any cache before retrieving the hierarchy */
[accountFolder flushMailCaches];
secondaryFolders = [[accountFolder toManyRelationshipKeysWithNamespaces: NO]
mutableCopy];
[secondaryFolders autorelease];

View File

@ -368,6 +368,11 @@ static Class SOGoMailFolderK, MAPIStoreMailFolderK, MAPIStoreOutboxFolderK;
if (sortOrderings)
[self errorWithFormat: @"sort orderings are not used for folders"];
/* FIXME: Flush any cache before retrieving the hierarchy, this
slows things down but it is safer */
if (!qualifier)
[sogoObject flushMailCaches];
subfolderKeys = [[sogoObject toManyRelationshipKeys] mutableCopy];
[subfolderKeys autorelease];