Monotone-Parent: 23072776516ad7ec761501356d062052d748d8c7

Monotone-Revision: 0803c3f82523e76024a78031ba0e71fce02404eb

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-02-24T20:40:07
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-02-24 20:40:07 +00:00
parent c96ae87f5b
commit 1feee33aa2
18 changed files with 218 additions and 2120 deletions

View File

@@ -27,6 +27,7 @@
#import "EOQualifier+MAPIFS.h"
#import "MAPIStoreTypes.h"
#import "MAPIStoreFSMessage.h"
#import "NSObject+MAPIStore.h"
#import "SOGoMAPIFSFolder.h"
#import "SOGoMAPIFSMessage.h"
@@ -38,69 +39,9 @@
@implementation MAPIStoreFSMessageTable
- (enum MAPISTATUS) getChildProperty: (void **) data
forKey: (NSString *) childKey
withTag: (enum MAPITAGS) propTag
{
NSDictionary *properties;
SOGoMAPIFSMessage *child;
id value;
enum MAPISTATUS rc;
child = [self lookupChild: childKey];
properties = [child properties];
value = [properties objectForKey: MAPIPropertyKey (propTag)];
if (value)
rc = [value getMAPIValue: data forTag: propTag inMemCtx: memCtx];
else
rc = [super getChildProperty: data forKey: childKey withTag: propTag];
return rc;
}
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
{
return [NSString stringWithFormat: @"%@", MAPIPropertyKey (property)];
}
- (NSArray *) childKeys
{
return [folder toOneRelationshipKeys];
}
- (NSArray *) restrictedChildKeys
{
NSMutableArray *keys;
NSArray *allKeys;
NSUInteger count, max;
NSString *messageKey;
allKeys = [self cachedChildKeys];
if (restrictionState == MAPIRestrictionStateAlwaysTrue)
keys = (NSMutableArray *) allKeys;
else if (restrictionState == MAPIRestrictionStateAlwaysFalse)
keys = (NSMutableArray *) [NSArray array];
else
{
[self logWithFormat: @"%s: getting restricted keys", __PRETTY_FUNCTION__];
max = [allKeys count];
keys = [NSMutableArray arrayWithCapacity: max];
if (restrictionState == MAPIRestrictionStateNeedsEval)
{
for (count = 0; count < max; count++)
{
messageKey = [allKeys objectAtIndex: count];
if ([restriction evaluateMAPIFSMessage:
[folder lookupName: messageKey
inContext: nil
acquire: NO]])
[keys addObject: messageKey];
}
}
[self logWithFormat: @" resulting keys: $$$%@$$$", keys];
}
return keys;
}
@end