mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-05 05:18:51 +00:00
Monotone-Parent: 9109f0600492701322f24fb53d86a39821e26dc4
Monotone-Revision: cb5283601b9539bb382aa64a739bf758b9e2ac7f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-10-03T20:53:56 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user