mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-04 21:08:51 +00:00
Monotone-Parent: 07cb9d1891b96efc9f2a3c78eacb86dadf65aaa2
Monotone-Revision: d4d8cd09603e421c6484fb4c83e461c0f987a5ab Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-09-20T19:38:23 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
2011-09-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreObject.m (-getReplicaKeyFromGlobCnt:): new
|
||||
method that returns the same result as
|
||||
getReplicaKey:fromGlobCnt:inMemCtx: in the form of an NSData
|
||||
instance.
|
||||
|
||||
* OpenChange/MAPIStoreContactsMessage.m (-save): same as below.
|
||||
|
||||
* OpenChange/MAPIStoreTasksMessage.m (-save): same as below.
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
|
||||
@interface MAPIStoreGCSMessage : MAPIStoreMessage
|
||||
{
|
||||
@private
|
||||
uint64_t _version;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -27,24 +27,16 @@
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStoreGCSFolder.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "NSData+MAPIStore.h"
|
||||
|
||||
#import "MAPIStoreGCSMessage.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
|
||||
@implementation MAPIStoreGCSMessage
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
_version = 0xffffffffffffffffLL;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSCalendarDate *) creationTime
|
||||
{
|
||||
return [sogoObject creationDate];
|
||||
@@ -55,24 +47,52 @@
|
||||
return [sogoObject lastModified];
|
||||
}
|
||||
|
||||
- (int) getPrChangeKey: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
NSData *changeKey;
|
||||
|
||||
if (isNew)
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
else
|
||||
{
|
||||
changeKey = [(MAPIStoreGCSFolder *)[self container]
|
||||
changeKeyForMessageWithKey: [self nameInContainer]];
|
||||
if (!changeKey)
|
||||
abort ();
|
||||
*data = [changeKey asBinaryInMemCtx: memCtx];
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) getPrPredecessorChangeList: (void **) data
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
{
|
||||
int rc = MAPISTORE_SUCCESS;
|
||||
NSData *changeList;
|
||||
|
||||
if (isNew)
|
||||
rc = MAPISTORE_ERR_NOT_FOUND;
|
||||
else
|
||||
{
|
||||
changeList = [(MAPIStoreGCSFolder *)[self container]
|
||||
predecessorChangeListForMessageWithKey: [self nameInContainer]];
|
||||
if (!changeList)
|
||||
abort ();
|
||||
*data = [changeList asBinaryInMemCtx: memCtx];
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (uint64_t) objectVersion
|
||||
{
|
||||
uint64_t version = 0xffffffffffffffffLL;
|
||||
NSNumber *changeNumber;
|
||||
|
||||
if ([sogoObject isNew])
|
||||
{
|
||||
#if 0
|
||||
if (_version == 0xffffffffffffffffLL)
|
||||
{
|
||||
_version = [[self context] getNewChangeNumber];
|
||||
[(MAPIStoreGCSFolder *)[self container] setInitialVersion: _version
|
||||
forMessage: [self nameInContainer]];
|
||||
}
|
||||
version = _version;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
if (!isNew)
|
||||
{
|
||||
changeNumber = [(MAPIStoreGCSFolder *) container
|
||||
changeNumberForMessageWithKey: [self nameInContainer]];
|
||||
|
||||
Reference in New Issue
Block a user