merge of '1e156d58cc527cdcdd61317d54c6ba7dc0b863c2'

and 'd830b49b93b3b05bd3b392063b915cc6954ee1a1'

Monotone-Parent: 1e156d58cc527cdcdd61317d54c6ba7dc0b863c2
Monotone-Parent: d830b49b93b3b05bd3b392063b915cc6954ee1a1
Monotone-Revision: e287e19d922a91499f1429d7f16d9bd161d1260e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-09-23T20:04:32
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2011-09-23 20:04:32 +00:00
3 changed files with 28 additions and 4 deletions

View File

@@ -12,6 +12,14 @@
2011-09-23 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreGCSMessage.m (-getPrChangeKey:inMemCtx:):
first force a synchronisation of the parent cache if the change key
cannot be retrieved and invoke abort if the change key is still
not available afterwards.
* OpenChange/MAPIStoreMailMessage.m (-getPrChangeKey:inMemCtx:):
same as above.
* OpenChange/MAPIStoreMailFolder.m (-lastMessageModificationTime):
invoke "synchroniseCache" in order to make sure we return the real
last modification time.

View File

@@ -52,13 +52,21 @@
{
int rc = MAPISTORE_SUCCESS;
NSData *changeKey;
MAPIStoreGCSFolder *parentFolder;
NSString *nameInContainer;
if (isNew)
rc = MAPISTORE_ERR_NOT_FOUND;
else
{
changeKey = [(MAPIStoreGCSFolder *)[self container]
changeKeyForMessageWithKey: [self nameInContainer]];
parentFolder = (MAPIStoreGCSFolder *)[self container];
nameInContainer = [self nameInContainer];
changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer];
if (!changeKey)
{
[parentFolder synchroniseCache];
changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer];
}
if (!changeKey)
abort ();
*data = [changeKey asBinaryInMemCtx: memCtx];

View File

@@ -284,13 +284,21 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
{
int rc = MAPISTORE_SUCCESS;
NSData *changeKey;
MAPIStoreMailFolder *parentFolder;
NSString *nameInContainer;
if (isNew)
rc = MAPISTORE_ERR_NOT_FOUND;
else
{
changeKey = [(MAPIStoreMailFolder *)[self container]
changeKeyForMessageWithKey: [self nameInContainer]];
parentFolder = (MAPIStoreMailFolder *)[self container];
nameInContainer = [self nameInContainer];
changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer];
if (!changeKey)
{
[parentFolder synchroniseCache];
changeKey = [parentFolder changeKeyForMessageWithKey: nameInContainer];
}
if (!changeKey)
abort ();
*data = [changeKey asBinaryInMemCtx: memCtx];