mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 11:25:24 +00:00
Monotone-Parent: 7016b89d1c4abd33e846818e244ff6fabde5521e
Monotone-Revision: d6705d8dd1250d749b03b17d0e2cd2f84e97f49a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-07-27T21:59:37 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
2011-07-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreFolder.m
|
||||
(-faiMessageKeysMatchingQualifier:andSortOrderings:):
|
||||
reimplemented method to make use of the new method below.
|
||||
|
||||
* OpenChange/SOGoMAPIFSFolder.m
|
||||
(-toOneRelationshipKeysMatchingQualifier:andSortOrderings:): moved
|
||||
method from -[MAPIStoreFSFolder
|
||||
messageKeysMatchingQualifier:andSortOrderings:] in order to make
|
||||
it available to all the SOGoMAPIFSFolder clients.
|
||||
|
||||
* OpenChange/MAPIStoreContext.m (-getNewChangeNumber): new
|
||||
utility method that returns a change number from the mapistore db
|
||||
via the openchangedb API.
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#import <Foundation/NSURL.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import "EOQualifier+MAPIFS.h"
|
||||
#import "MAPIStoreFSMessage.h"
|
||||
#import "MAPIStoreFSMessageTable.h"
|
||||
#import "MAPIStoreFolderTable.h"
|
||||
@@ -113,36 +112,9 @@ static Class MAPIStoreFSMessageK;
|
||||
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
|
||||
andSortOrderings: (NSArray *) sortOrderings
|
||||
{
|
||||
NSArray *allKeys;
|
||||
NSMutableArray *keys;
|
||||
NSUInteger count, max;
|
||||
NSString *messageKey;
|
||||
SOGoMAPIFSMessage *message;
|
||||
|
||||
if (sortOrderings)
|
||||
[self warnWithFormat: @"sorting is not handled yet"];
|
||||
|
||||
allKeys = [sogoObject toOneRelationshipKeys];
|
||||
if (qualifier)
|
||||
{
|
||||
[self logWithFormat: @"%s: getting restricted keys", __PRETTY_FUNCTION__];
|
||||
max = [allKeys count];
|
||||
keys = [NSMutableArray arrayWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
messageKey = [allKeys objectAtIndex: count];
|
||||
message = [sogoObject lookupName: messageKey
|
||||
inContext: nil
|
||||
acquire: NO];
|
||||
if ([qualifier evaluateMAPIFSMessage: message])
|
||||
[keys addObject: messageKey];
|
||||
}
|
||||
[self logWithFormat: @" resulting keys: $$$%@$$$", keys];
|
||||
}
|
||||
else
|
||||
keys = (NSMutableArray *) allKeys;
|
||||
|
||||
return keys;
|
||||
return [(SOGoMAPIFSFolder *) sogoObject
|
||||
toOneRelationshipKeysMatchingQualifier: qualifier
|
||||
andSortOrderings: sortOrderings];
|
||||
}
|
||||
|
||||
- (id) lookupFolder: (NSString *) childKey
|
||||
|
||||
@@ -618,12 +618,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
||||
- (NSArray *) faiMessageKeysMatchingQualifier: (EOQualifier *) qualifier
|
||||
andSortOrderings: (NSArray *) sortOrderings
|
||||
{
|
||||
if (qualifier)
|
||||
[self errorWithFormat: @"qualifier is not used for FAI messages"];
|
||||
if (sortOrderings)
|
||||
[self errorWithFormat: @"sort orderings are not used for FAI messages"];
|
||||
|
||||
return [faiFolder toOneRelationshipKeys];
|
||||
return [faiFolder
|
||||
toOneRelationshipKeysMatchingQualifier: qualifier
|
||||
andSortOrderings: sortOrderings];
|
||||
}
|
||||
|
||||
- (NSArray *) faiMessageKeys
|
||||
|
||||
@@ -25,8 +25,12 @@
|
||||
|
||||
#import <SOGo/SOGoFolder.h>
|
||||
|
||||
@class NSArray;
|
||||
@class NSString;
|
||||
@class NSURL;
|
||||
|
||||
@class EOQualifier;
|
||||
|
||||
@class SOGoMAPIFSMessage;
|
||||
|
||||
@interface SOGoMAPIFSFolder : SOGoFolder
|
||||
@@ -48,6 +52,9 @@
|
||||
- (NSCalendarDate *) creationTime;
|
||||
- (NSCalendarDate *) lastModificationTime;
|
||||
|
||||
- (NSArray *) toOneRelationshipKeysMatchingQualifier: (EOQualifier *) qualifier
|
||||
andSortOrderings: (NSArray *) sortOrderings;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* SOGOMAPIFSFOLDER_H */
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import "EOQualifier+MAPIFS.h"
|
||||
#import "SOGoMAPIFSMessage.h"
|
||||
|
||||
#import "SOGoMAPIFSFolder.h"
|
||||
@@ -217,6 +218,40 @@ static NSString *privateDir = nil;
|
||||
return [self _objectsInDirectory: NO];
|
||||
}
|
||||
|
||||
- (NSArray *) toOneRelationshipKeysMatchingQualifier: (EOQualifier *) qualifier
|
||||
andSortOrderings: (NSArray *) sortOrderings
|
||||
{
|
||||
NSArray *allKeys;
|
||||
NSMutableArray *keys;
|
||||
NSUInteger count, max;
|
||||
NSString *messageKey;
|
||||
SOGoMAPIFSMessage *message;
|
||||
|
||||
if (sortOrderings)
|
||||
[self warnWithFormat: @"sorting is not handled yet"];
|
||||
|
||||
allKeys = [self toOneRelationshipKeys];
|
||||
if (qualifier)
|
||||
{
|
||||
[self logWithFormat: @"%s: getting restricted FAI keys", __PRETTY_FUNCTION__];
|
||||
max = [allKeys count];
|
||||
keys = [NSMutableArray arrayWithCapacity: max];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
messageKey = [allKeys objectAtIndex: count];
|
||||
message = [self lookupName: messageKey
|
||||
inContext: nil
|
||||
acquire: NO];
|
||||
if ([qualifier evaluateMAPIFSMessage: message])
|
||||
[keys addObject: messageKey];
|
||||
}
|
||||
}
|
||||
else
|
||||
keys = (NSMutableArray *) allKeys;
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
- (id) lookupName: (NSString *) fileName
|
||||
inContext: (WOContext *) woContext
|
||||
acquire: (BOOL) acquire
|
||||
|
||||
Reference in New Issue
Block a user