diff --git a/OpenChange/MAPIStoreMailContext.m b/OpenChange/MAPIStoreMailContext.m index 87493ff09..f7a62fcd8 100644 --- a/OpenChange/MAPIStoreMailContext.m +++ b/OpenChange/MAPIStoreMailContext.m @@ -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]; diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index d2036454a..0e98b4af4 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -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];