mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-06 22:08:51 +00:00
Monotone-Parent: 98084e25c04125bc23a53907661020b8ac004a5d
Monotone-Revision: da065094ec85a862e2b55a9d2a9344f023a1495d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-27T22:04:49 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,5 +1,15 @@
|
||||
2011-07-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreFSMessageTable.m
|
||||
(-evaluatePropertyRestriction:intoQualifier:): overriden method to
|
||||
handle PR_CHANGE_NUM, based on the messages version number.
|
||||
|
||||
* OpenChange/MAPIStoreFSMessage.m (-objectVersion): overriden
|
||||
method to retrieve the object version from the "version" attribute
|
||||
in the properties list.
|
||||
(-save): update the "version" attribute in the saved property list
|
||||
from openchangedb.
|
||||
|
||||
* OpenChange/MAPIStoreAppointmentWrapper.m
|
||||
(-getPidLidGlobalObjectId:inMemCtx:): work-around certain buggy
|
||||
events which might now have a "CREATED" element.
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
#import "MAPIStoreContext.h"
|
||||
#import "MAPIStorePropertySelectors.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
@@ -33,6 +34,7 @@
|
||||
#import "MAPIStoreFSMessage.h"
|
||||
|
||||
#undef DEBUG
|
||||
#include <mapistore/mapistore.h>
|
||||
#include <mapistore/mapistore_errors.h>
|
||||
|
||||
@implementation MAPIStoreFSMessage
|
||||
@@ -72,6 +74,15 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (uint64_t) objectVersion
|
||||
{
|
||||
NSNumber *version;
|
||||
|
||||
version = [[sogoObject properties] objectForKey: @"version"];
|
||||
|
||||
return exchange_globcnt ([version unsignedLongLongValue]);
|
||||
}
|
||||
|
||||
- (int) getProperty: (void **) data
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
inMemCtx: (TALLOC_CTX *) memCtx
|
||||
@@ -176,8 +187,14 @@
|
||||
|
||||
- (void) save
|
||||
{
|
||||
uint64_t newVersion;
|
||||
|
||||
if ([attachmentKeys count] > 0)
|
||||
[newProperties setObject: attachmentParts forKey: @"attachments"];
|
||||
|
||||
newVersion = exchange_globcnt ([[self context] getNewChangeNumber] >> 16);
|
||||
[newProperties setObject: [NSNumber numberWithUnsignedLongLong: newVersion]
|
||||
forKey: @"version"];
|
||||
[sogoObject appendProperties: newProperties];
|
||||
[sogoObject save];
|
||||
[self resetNewProperties];
|
||||
|
||||
@@ -20,17 +20,12 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
#import <Foundation/NSString.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <EOControl/EOQualifier.h>
|
||||
|
||||
#import "EOQualifier+MAPIFS.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
#import "MAPIStoreFSMessage.h"
|
||||
#import "NSObject+MAPIStore.h"
|
||||
#import "SOGoMAPIFSFolder.h"
|
||||
#import "SOGoMAPIFSMessage.h"
|
||||
|
||||
#import "MAPIStoreFSMessageTable.h"
|
||||
|
||||
@@ -56,4 +51,31 @@ static Class MAPIStoreFSMessageK = Nil;
|
||||
return [NSString stringWithFormat: @"%@", MAPIPropertyKey (property)];
|
||||
}
|
||||
|
||||
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
|
||||
intoQualifier: (EOQualifier **) qualifier
|
||||
{
|
||||
MAPIRestrictionState rc;
|
||||
id value;
|
||||
NSNumber *version;
|
||||
uint64_t cVersion;
|
||||
|
||||
if ((uint32_t) res->ulPropTag == PR_CHANGE_NUM)
|
||||
{
|
||||
value = NSObjectFromMAPISPropValue (&res->lpProp);
|
||||
cVersion = exchange_globcnt ([value unsignedLongLongValue] >> 16);
|
||||
version = [NSNumber numberWithUnsignedLongLong: cVersion];
|
||||
[self logWithFormat: @"change number from oxcfxics: %.16lx", [value unsignedLongLongValue]];
|
||||
[self logWithFormat: @" version: %.16lx", cVersion];
|
||||
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: @"version"
|
||||
operatorSelector: EOQualifierOperatorGreaterThanOrEqualTo
|
||||
value: version];
|
||||
[*qualifier autorelease];
|
||||
rc = MAPIRestrictionStateNeedsEval;
|
||||
}
|
||||
else
|
||||
rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user