oc-contacts: Implement Wedding Anniversary

As specified by Microsoft using x-ms-anniversary custom vcard element
[MS-OXVCARD] Section 2.1.3.9.6
pull/69/head
Enrique J. Hernández Blasco 2015-01-16 01:34:16 +01:00
parent b5369530f0
commit b35fee8efc
1 changed files with 30 additions and 0 deletions

View File

@ -723,6 +723,27 @@
return rc;
}
- (int) getPidTagWeddingAnniversary: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
NSCalendarDate *dateValue;
NSString *stringValue;
int rc = MAPISTORE_SUCCESS;
stringValue = [[[sogoObject vCard] uniqueChildWithTag: @"x-ms-anniversary"]
flattenedValuesForKey: @""];
if (stringValue && ! [stringValue isEqualToString: @""])
{
dateValue = [NSCalendarDate dateWithString: stringValue
calendarFormat: @"%Y-%m-%d"];
*data = [dateValue asFileTimeInMemCtx: memCtx];
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
return rc;
}
//
// Decomposed fullname getters
//
@ -1173,6 +1194,15 @@ fromProperties: (NSDictionary *) attachmentProps
[newCard setBday: [value descriptionWithCalendarFormat: @"%Y-%m-%d"]];
}
/* wedding anniversary */
value = [properties objectForKey: MAPIPropertyKey(PidTagWeddingAnniversary)];
if (value)
{
[[newCard uniqueChildWithTag: @"x-ms-anniversary"]
setSingleValue: [value descriptionWithCalendarFormat: @"%Y-%m-%d"]
forKey: @""];
}
/* photo */
if ([attachmentParts count] > 0)
{