Monotone-Parent: 9109f0600492701322f24fb53d86a39821e26dc4

Monotone-Revision: cb5283601b9539bb382aa64a739bf758b9e2ac7f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-10-03T20:53:56
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-10-03 20:53:56 +00:00
parent 01e387b7b9
commit 88a5fec753
4 changed files with 49 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2011-10-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreSOGo.m (sogo_message_modify_recipients):
this backend op now has a "columns" arguments for the dynamic data
records.
2011-09-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailMessage.m (-getMessageData:inMemCtx:):

View File

@ -51,7 +51,8 @@ extern NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email);
inMemCtx: (TALLOC_CTX *) memCtx;
- (int) modifyRecipientsWithRows: (struct ModifyRecipientRow *) rows
andCount: (NSUInteger) max;
andCount: (NSUInteger) max
andColumns: (struct SPropTagArray *) columns;
- (NSArray *) attachmentKeys;
- (NSArray *) attachmentKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;

View File

@ -204,10 +204,14 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email)
}
- (NSDictionary *) _convertRecipientFromRow: (struct RecipientRow *) row
andColumns: (struct SPropTagArray *) columns
{
NSMutableDictionary *recipient;
NSString *value;
NSMutableDictionary *recipient, *properties;
SOGoUser *recipientUser;
NSUInteger count, dataPos;
struct mapi_SPropValue mapiValue;
id value;
TALLOC_CTX *memCtx;
recipient = [NSMutableDictionary dictionaryWithCapacity: 5];
@ -260,11 +264,39 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email)
[recipient setObject: value forKey: @"fullName"];
}
properties = [NSMutableDictionary new];
[recipient setObject: properties forKey: @"properties"];
dataPos = 0;
memCtx = talloc_zero (NULL, TALLOC_CTX);
for (count = 0; count < columns->cValues; count++)
{
mapiValue.ulPropTag = columns->aulPropTag[count];
if (row->layout)
{
if (row->prop_values.data[dataPos])
{
dataPos += 5;
continue;
}
else
dataPos++;
}
set_mapi_SPropValue (memCtx, &mapiValue, row->prop_values.data + dataPos);
value = NSObjectFromMAPISPropValue (&mapiValue);
dataPos += get_mapi_property_size (&mapiValue);
if (value)
[properties setObject: value forKey: MAPIPropertyKey (columns->aulPropTag[count])];
}
[properties release];
talloc_free (memCtx);
return recipient;
}
- (int) modifyRecipientsWithRows: (struct ModifyRecipientRow *) rows
andCount: (NSUInteger) max
andColumns: (struct SPropTagArray *) columns
{
static NSString *recTypes[] = { @"orig", @"to", @"cc", @"bcc" };
NSDictionary *recipientProperties;
@ -296,8 +328,9 @@ NSData *MAPIStoreExternalEntryId (NSString *cn, NSString *email)
[recipients setObject: list forKey: recType];
[list release];
}
[list addObject: [self _convertRecipientFromRow:
&(currentRow->RecipientRow)]];
[list addObject:
[self _convertRecipientFromRow: &(currentRow->RecipientRow)
andColumns: columns]];
}
}
[self addNewProperties: recipientProperties];

View File

@ -642,6 +642,7 @@ sogo_message_get_attachment_table (void *message_object, TALLOC_CTX *mem_ctx, vo
static int
sogo_message_modify_recipients (void *message_object,
struct SPropTagArray *columns,
struct ModifyRecipientRow *recipients,
uint16_t count)
{
@ -657,7 +658,9 @@ sogo_message_modify_recipients (void *message_object,
wrapper = message_object;
message = wrapper->MAPIStoreSOGoObject;
pool = [NSAutoreleasePool new];
rc = [message modifyRecipientsWithRows: recipients andCount: count];
rc = [message modifyRecipientsWithRows: recipients
andCount: count
andColumns: columns];
// [context tearDownRequest];
[pool release];
}