Monotone-Parent: 9a2499685fbc7c107c6a8a04f34c7435343e64f4

Monotone-Revision: 24436aa1f7c157e01afd314ceccdf0d59418faa7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-08-12T18:40:07
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-08-12 18:40:07 +00:00
parent 90b11f541e
commit efdee42eba
2 changed files with 27 additions and 6 deletions

View File

@ -1,5 +1,9 @@
2011-08-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreGCSMessage.m (-objectVersion): ensure that a
change number is available when the message is "not new", but
resynchronise the cache in doing so.
* OpenChange/MAPIStoreSOGo.m (sogo_table_handle_destructor): added
new backend operation.

View File

@ -21,6 +21,7 @@
*/
#import <Foundation/NSValue.h>
#import <NGExtensions/NSObject+Logs.h>
#import <SOGo/SOGoContentObject.h>
#import "MAPIStoreGCSFolder.h"
@ -48,12 +49,28 @@
uint64_t version = 0xffffffffffffffffLL;
NSNumber *changeNumber;
changeNumber = [(MAPIStoreGCSFolder *) container
changeNumberForMessageWithKey: [self nameInContainer]];
if (changeNumber)
version = [changeNumber unsignedLongLongValue] >> 16;
else if (![sogoObject isNew])
abort ();
if (![sogoObject isNew])
{
changeNumber = [(MAPIStoreGCSFolder *) container
changeNumberForMessageWithKey: [self nameInContainer]];
if (!changeNumber)
{
[self warnWithFormat: @"attempting to get change number"
@" by synchronising folder..."];
[(MAPIStoreGCSFolder *) container synchroniseCache];
changeNumber = [(MAPIStoreGCSFolder *) container
changeNumberForMessageWithKey: [self nameInContainer]];
if (changeNumber)
[self logWithFormat: @"got one"];
else
{
[self errorWithFormat: @"still nothing. We crash!"];
abort ();
}
}
version = [changeNumber unsignedLongLongValue] >> 16;
}
return version;
}