diff --git a/ChangeLog b/ChangeLog index 26dd1567a..956996a75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-22 Ludovic Marcotte + + * OpenChange/MAPIStoreContactsMessage.m + Added more field mappings (surname, given name, + middle name, etc.) + 2011-09-22 Wolfgang Sourdeau * OpenChange/MAPIStoreDraftsMessage.m (-getPrChangeKey) diff --git a/OpenChange/MAPIStoreContactsMessage.m b/OpenChange/MAPIStoreContactsMessage.m index ab03c8410..13dbc4fcc 100644 --- a/OpenChange/MAPIStoreContactsMessage.m +++ b/OpenChange/MAPIStoreContactsMessage.m @@ -111,6 +111,7 @@ // return MAPISTORE_SUCCESS; // } + - (int) getPrTitle: (void **) data inMemCtx: (TALLOC_CTX *) memCtx { @@ -664,6 +665,67 @@ return rc; } +// +// Decomposed fullname getters +// +- (int) getPrSurname: (void **) data + inMemCtx: (TALLOC_CTX *) memCtx +{ + NSString *stringValue; + + stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 0]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + + return MAPISTORE_SUCCESS; +} + +- (int) getPrGivenName: (void **) data + inMemCtx: (TALLOC_CTX *) memCtx +{ + NSString *stringValue; + + stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 1]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + + return MAPISTORE_SUCCESS; +} + +- (int) getPrMiddleName: (void **) data + inMemCtx: (TALLOC_CTX *) memCtx +{ + NSString *stringValue; + + stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 2]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + + return MAPISTORE_SUCCESS; +} + +- (int) getPrDisplayNamePrefix: (void **) data + inMemCtx: (TALLOC_CTX *) memCtx +{ + NSString *stringValue; + + stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 3]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + + return MAPISTORE_SUCCESS; +} + +- (int) getPrGeneration: (void **) data + inMemCtx: (TALLOC_CTX *) memCtx +{ + NSString *stringValue; + + stringValue = [[[sogoObject vCard] firstChildWithTag: @"n"] value: 4]; + *data = [stringValue asUnicodeInMemCtx: memCtx]; + + return MAPISTORE_SUCCESS; +} + +// +// +// - (void) save { NSArray *elements, *units;