Monotone-Parent: 13c5aa721d9d4217c5d7294d7498865eadb1f488

Monotone-Revision: ac4faf22e87401aa7760c8fa7dd769a9bb1120fb

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-08-11T16:37:23
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-08-11 16:37:23 +00:00
parent 83374dbee2
commit f56f6174eb
2 changed files with 29 additions and 2 deletions

View File

@@ -1,5 +1,8 @@
2011-08-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreFolder.m (-objectVersion): implemented
method based on the value provided in the folder props dictionary.
* OpenChange/MAPIStoreObject.m (-objectVersion): now a mandatory
method for subclasses.

View File

@@ -49,6 +49,7 @@
#include <gen_ndr/exchange.h>
#undef DEBUG
#include <libmapiproxy.h>
#include <mapistore/mapistore.h>
#include <mapistore/mapistore_nameid.h>
#include <mapistore/mapistore_errors.h>
@@ -143,6 +144,30 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
}
/* backend interface */
- (uint64_t) objectVersion
{
NSNumber *value;
NSDictionary *props;
uint64_t cn;
props = [propsMessage properties];
value = [props objectForKey: MAPIPropertyKey (PR_CHANGE_NUM)];
if (value)
cn = [value unsignedLongLongValue];
else
{
[self logWithFormat: @"no value for PR_CHANGE_NUM, adding one now"];
cn = [[self context] getNewChangeNumber];
value = [NSNumber numberWithUnsignedLongLong: cn];
props = [NSDictionary dictionaryWithObject: value
forKey: MAPIPropertyKey (PR_CHANGE_NUM)];
[propsMessage appendProperties: props];
[propsMessage save];
}
return cn >> 16;
}
- (id) lookupFolder: (NSString *) folderKey
{
MAPIStoreFolder *childFolder = nil;
@@ -619,8 +644,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
{
static enum MAPITAGS bannedProps[] = { PR_MID, PR_FID, PR_PARENT_FID,
PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY,
PR_CHANGE_NUM, PR_CHANGE_KEY,
0x00000000 };
PR_CHANGE_KEY, 0x00000000 };
enum MAPITAGS *currentProp;
int rc;