mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-03 20:38:50 +00:00
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:
@@ -20,12 +20,9 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import <SOGo/SOGoFolder.h>
|
||||
|
||||
#import "MAPIStoreFolder.h"
|
||||
#import "MAPIStoreMapping.h"
|
||||
#import "MAPIStoreTypes.h"
|
||||
|
||||
@@ -47,83 +44,13 @@ static MAPIStoreMapping *mapping;
|
||||
|
||||
- (NSArray *) childKeys
|
||||
{
|
||||
return [NSArray array];
|
||||
// return [folder toManyRelationshipKeys];
|
||||
return [(MAPIStoreFolder *) container folderKeys];
|
||||
}
|
||||
|
||||
- (NSArray *) restrictedChildKeys
|
||||
{
|
||||
[self errorWithFormat: @"restrictions are ignored on mail folder tables"];
|
||||
return [folder toManyRelationshipKeys];
|
||||
}
|
||||
|
||||
- (enum MAPISTATUS) getChildProperty: (void **) data
|
||||
forKey: (NSString *) childKey
|
||||
withTag: (enum MAPITAGS) propTag
|
||||
{
|
||||
SOGoFolder *child;
|
||||
// id child;
|
||||
// struct Binary_r *binaryValue;
|
||||
NSString *childURL;
|
||||
uint32_t contextId;
|
||||
uint64_t mappingId;
|
||||
int rc;
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
switch (propTag)
|
||||
{
|
||||
case PR_FID:
|
||||
childURL = [NSString stringWithFormat: @"%@%@", folderURL, childKey];
|
||||
mappingId = [mapping idFromURL: childURL];
|
||||
if (mappingId == NSNotFound)
|
||||
{
|
||||
openchangedb_get_new_folderID (ldbCtx, &mappingId);
|
||||
[mapping registerURL: childURL withID: mappingId];
|
||||
contextId = 0;
|
||||
mapistore_search_context_by_uri (memCtx, [folderURL UTF8String] + 7,
|
||||
&contextId);
|
||||
mapistore_indexing_record_add_mid (memCtx, contextId, mappingId);
|
||||
}
|
||||
*data = MAPILongLongValue (memCtx, mappingId);
|
||||
break;
|
||||
case PR_ACCESS: // TODO
|
||||
*data = MAPILongValue (memCtx, 0x63);
|
||||
break;
|
||||
case PR_ACCESS_LEVEL: // TODO
|
||||
*data = MAPILongValue (memCtx, 0x01);
|
||||
break;
|
||||
case PR_PARENT_FID:
|
||||
*data = MAPILongLongValue (memCtx, fid);
|
||||
break;
|
||||
case PR_ATTR_HIDDEN:
|
||||
case PR_ATTR_SYSTEM:
|
||||
case PR_ATTR_READONLY:
|
||||
*data = MAPIBoolValue (memCtx, NO);
|
||||
break;
|
||||
case PR_SUBFOLDERS:
|
||||
child = [self lookupChild: childKey];
|
||||
*data = MAPIBoolValue (memCtx, 0);
|
||||
// [[child toManyRelationshipKeys] count] > 0);
|
||||
// *data = MAPIBoolValue (memCtx,
|
||||
// [[child toManyRelationshipKeys] count] > 0);
|
||||
break;
|
||||
case PR_CONTENT_COUNT:
|
||||
child = [self lookupChild: childKey];
|
||||
*data = MAPILongValue (memCtx,
|
||||
[[child toOneRelationshipKeys] count]);
|
||||
break;
|
||||
// case PR_EXTENDED_FOLDER_FLAGS: // TODO: DOUBT: how to indicate the
|
||||
// // number of subresponses ?
|
||||
// binaryValue = talloc_zero(memCtx, struct Binary_r);
|
||||
// *data = binaryValue;
|
||||
// break;
|
||||
default:
|
||||
rc = [super getChildProperty: data
|
||||
forKey: childKey
|
||||
withTag: propTag];
|
||||
}
|
||||
|
||||
return rc;
|
||||
[self errorWithFormat: @"restrictions are ignored on folder tables"];
|
||||
return [self childKeys];
|
||||
}
|
||||
|
||||
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
|
||||
|
||||
Reference in New Issue
Block a user