Merge pull request #133 from Zentyal/ejhernandez/flush-cache

oc-mail: Flush IMAP hierarchy cache to update Outlook folders
pull/84/head
Julio J. García Martín 2015-05-07 09:53:49 +02:00
commit 582c24afc5
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

@ -379,6 +379,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];