Monotone-Parent: 9634e883abb4f5cf42e1b4d9c3d3e1b1a61f3e7f

Monotone-Revision: c7755bd4c79d8115db4835ecb7a3fb92ab273020

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-11-30T16:17:50
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2010-11-30 16:17:50 +00:00
parent d1fa84ff94
commit 8849fbf7c4
7 changed files with 117 additions and 87 deletions

View File

@ -1,3 +1,16 @@
2010-11-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreContext.m
(-getFolderTableChildproperty:atURL:withTag:inFolder:withFID:,-getMessageTableChildproperty:atURL:withTag:inFolder:withFID:)
(-getCommonTableChildproperty:atURL:withTag:inFolder:withFID:):
now return an "enum MAPISTATUS" for making debugging easier.
(_createMessageWithMID:inFID:): display an error when the returned
message is nil.
(-getMessageProperties:inRow:atURL:): when an error code is
returned from the getXXXChildProperty.. methods, the tag is set to
its corresponding error tag and the error code is returned as a
long value.
2010-11-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreTypes.m (NSObjectFromStreamData): new

View File

@ -73,11 +73,11 @@
return [(SOGoGCSFolder *) folder componentKeysWithType: @"vevent"];
}
- (int) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
// id child;
id event;
@ -181,7 +181,7 @@
// - (int) getFolderTableChildproperty: (void **) data
// atURL: (NSString *) childURL
// withTag: (uint32_t) proptag
// withTag: (enum MAPITAGS) proptag
// inFolder: (SOGoFolder *) folder
// withFID: (uint64_t) fid
// {

View File

@ -75,9 +75,9 @@
return [(SOGoGCSFolder *) folder componentKeysWithType: @"vcard"];
}
// - (int) getCommonTableChildproperty: (void **) data
// - (enum MAPISTATUS) getCommonTableChildproperty: (void **) data
// atURL: (NSString *) childURL
// withTag: (uint32_t) proptag
// withTag: (enum MAPITAGS) proptag
// inFolder: (SOGoFolder *) folder
// withFID: (uint64_t) fid
// {
@ -137,15 +137,15 @@
return phone;
}
- (int) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
NSString *stringValue;
id child;
int rc;
enum MAPISTATUS rc;
rc = MAPI_E_SUCCESS;
switch (proptag)
@ -296,9 +296,9 @@
return newEntry;
}
// - (int) getFolderTableChildproperty: (void **) data
// - (enum MAPISTATUS) getFolderTableChildproperty: (void **) data
// atURL: (NSString *) childURL
// withTag: (uint32_t) proptag
// withTag: (enum MAPITAGS) proptag
// inFolder: (SOGoFolder *) folder
// withFID: (uint64_t) fid
// {

View File

@ -91,11 +91,11 @@
byName: (const char *) foldername
inParentFID: (uint64_t) parent_fid;
- (int) getTableProperty: (void **) data
withTag: (uint32_t) proptag
atPosition: (uint32_t) pos
withTableType: (uint8_t) tableType
inFID: (uint64_t) fid;
- (enum MAPISTATUS) getTableProperty: (void **) data
withTag: (enum MAPITAGS) proptag
atPosition: (uint32_t) pos
withTableType: (uint8_t) tableType
inFID: (uint64_t) fid;
- (int) mkDir: (struct SRow *) aRow
withFID: (uint64_t) fid
@ -140,23 +140,23 @@
- (NSArray *) getFolderMessageKeys: (SOGoFolder *) folder;
- (int) getCommonTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid;
- (enum MAPISTATUS) getCommonTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid;
- (int) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid;
- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid;
- (int) getFolderTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid;
- (enum MAPISTATUS) getFolderTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid;
- (int) getFoldersList: (struct indexing_folders_list **) folders_list
withFMID: (uint64_t) fmid;

View File

@ -596,11 +596,11 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
return rc;
}
- (int) getCommonTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getCommonTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
// NSString *stringValue;
id child;
@ -638,11 +638,11 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
return rc;
}
- (int) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
int rc;
uint32_t contextId;
@ -765,11 +765,11 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
return newURL;
}
- (int) getFolderTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getFolderTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
// id child;
struct Binary_r *binaryValue;
@ -834,11 +834,11 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
return rc;
}
- (int) getTableProperty: (void **) data
withTag: (uint32_t) proptag
atPosition: (uint32_t) pos
withTableType: (uint8_t) tableType
inFID: (uint64_t) fid
- (enum MAPISTATUS) getTableProperty: (void **) data
withTag: (enum MAPITAGS) proptag
atPosition: (uint32_t) pos
withTableType: (uint8_t) tableType
inFID: (uint64_t) fid
{
NSArray *children;
NSString *folderURL, *childURL, *childName;
@ -994,6 +994,10 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
[message nameInContainer]];
[mapping registerURL: messageURL withID: mid];
}
else
[self errorWithFormat:
@"no message created in folder '%.16x' with mid '%.16x'",
fid, mid];
}
}
else
@ -1100,7 +1104,8 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
id child;
NSInteger count;
void *propValue;
uint32_t tag;
enum MAPITAGS tag;
enum MAPISTATUS propRc;
int rc;
child = [self lookupObject: childURL];
@ -1111,17 +1116,22 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
for (count = 0; count < sPropTagArray->cValues; count++)
{
tag = sPropTagArray->aulPropTag[count];
if ([self getMessageTableChildproperty: &propValue
atURL: childURL
withTag: tag
inFolder: nil
withFID: 0]
== MAPI_E_SUCCESS)
{
set_SPropValue_proptag (&(aRow->lpProps[aRow->cValues]),
tag, propValue);
aRow->cValues++;
propValue = NULL;
propRc = [self getMessageTableChildproperty: &propValue
atURL: childURL
withTag: tag
inFolder: nil
withFID: 0];
if (propRc != MAPI_E_SUCCESS)
{
if (propValue)
talloc_free (propValue);
propValue = MAPILongValue (memCtx, propRc);
tag = (tag & 0xffff0000) | 0x000a;
}
set_SPropValue_proptag (&(aRow->lpProps[aRow->cValues]),
tag, propValue);
aRow->cValues++;
}
rc = MAPI_E_SUCCESS;
}

View File

@ -89,9 +89,9 @@
return [(SOGoMailFolder *) folder toOneRelationshipKeys];
}
// - (int) getCommonTableChildproperty: (void **) data
// - (enum MAPISTATUS) getCommonTableChildproperty: (void **) data
// atURL: (NSString *) childURL
// withTag: (uint32_t) proptag
// withTag: (enum MAPITAGS) proptag
// inFolder: (SOGoFolder *) folder
// withFID: (uint64_t) fid
// {
@ -110,15 +110,15 @@
// return rc;
// }
- (int) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
id child;
NSCalendarDate *offsetDate;
int rc;
enum MAPISTATUS rc;
rc = MAPI_E_SUCCESS;
switch (proptag)
@ -246,7 +246,13 @@
@"fetch"];
key = [[keys objectAtIndex: 0] objectForKey: @"key"];
content = [[result objectForKey: key] objectForKey: @"data"];
*data = [content asBinaryInMemCtx: memCtx];
if ([content length] > 3999)
{
*data = NULL;
rc = MAPI_E_NOT_ENOUGH_RESOURCES;
}
else
*data = [content asBinaryInMemCtx: memCtx];
}
else
{
@ -290,6 +296,7 @@
child = [self lookupObject: childURL];
*data = [[child from] asUnicodeInMemCtx: memCtx];
break;
case PR_INTERNET_MESSAGE_ID:
case PR_INTERNET_MESSAGE_ID_UNICODE:
child = [self lookupObject: childURL];
*data = [[child messageId] asUnicodeInMemCtx: memCtx];
@ -401,13 +408,13 @@
return rc;
}
- (int) getFolderTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getFolderTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
int rc;
enum MAPISTATUS rc;
rc = MAPI_E_SUCCESS;
switch (proptag)

View File

@ -71,11 +71,11 @@
return [(SOGoGCSFolder *) folder componentKeysWithType: @"vtodo"];
}
- (int) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (uint32_t) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
- (enum MAPISTATUS) getMessageTableChildproperty: (void **) data
atURL: (NSString *) childURL
withTag: (enum MAPITAGS) proptag
inFolder: (SOGoFolder *) folder
withFID: (uint64_t) fid
{
NSString *status;
// id child;