Monotone-Parent: cb5cc3133ac0a2327dd3cc8408ecc03e59d08d44
Monotone-Revision: 9466acabd40c4707e1c9468170d5b231345d8cf9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-01-11T17:18:11 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
006da94bd5
commit
a15f06c844
|
@ -1,3 +1,8 @@
|
||||||
|
2011-01-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* OpenChange/SOGoContactGCSEntry+MAPIStore.m
|
||||||
|
(-setMAPIProperties:): added support for work address.
|
||||||
|
|
||||||
2011-01-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2011-01-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* OpenChange/MAPIStoreContext.m (-typeLessTag:): removed method as
|
* OpenChange/MAPIStoreContext.m (-typeLessTag:): removed method as
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/NSArray.h>
|
||||||
#import <Foundation/NSDictionary.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <Foundation/NSValue.h>
|
#import <Foundation/NSValue.h>
|
||||||
|
@ -38,6 +39,8 @@
|
||||||
- (void) setMAPIProperties: (NSDictionary *) properties
|
- (void) setMAPIProperties: (NSDictionary *) properties
|
||||||
{
|
{
|
||||||
NGVCard *newCard, *oldCard;
|
NGVCard *newCard, *oldCard;
|
||||||
|
NSArray *addresses;
|
||||||
|
CardElement *adr;
|
||||||
id value;
|
id value;
|
||||||
|
|
||||||
[self logWithFormat: @"setMAPIProperties: %@", properties];
|
[self logWithFormat: @"setMAPIProperties: %@", properties];
|
||||||
|
@ -66,6 +69,41 @@
|
||||||
if (value)
|
if (value)
|
||||||
[newCard addEmail: value types: nil];
|
[newCard addEmail: value types: nil];
|
||||||
|
|
||||||
|
/* Work address */
|
||||||
|
addresses = [newCard childrenWithTag: @"adr"
|
||||||
|
andAttribute: @"type"
|
||||||
|
havingValue: @"work"];
|
||||||
|
if ([addresses count] > 0)
|
||||||
|
{
|
||||||
|
adr = [addresses objectAtIndex: 0];
|
||||||
|
[adr setValues: nil];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
adr = [CardElement elementWithTag: @"adr"];
|
||||||
|
[adr addAttribute: @"type" value: @"work"];
|
||||||
|
[card addChild: adr];
|
||||||
|
}
|
||||||
|
|
||||||
|
value = [properties objectForKey: MAPIPropertyKey (PidLidWorkAddressPostOfficeBox)];
|
||||||
|
if (value)
|
||||||
|
[adr setValue: 0 to: value];
|
||||||
|
value = [properties objectForKey: MAPIPropertyKey (PidLidWorkAddressStreet)];
|
||||||
|
if (value)
|
||||||
|
[adr setValue: 2 to: value];
|
||||||
|
value = [properties objectForKey: MAPIPropertyKey (PidLidWorkAddressCity)];
|
||||||
|
if (value)
|
||||||
|
[adr setValue: 3 to: value];
|
||||||
|
value = [properties objectForKey: MAPIPropertyKey (PidLidWorkAddressState)];
|
||||||
|
if (value)
|
||||||
|
[adr setValue: 4 to: value];
|
||||||
|
value = [properties objectForKey: MAPIPropertyKey (PidLidWorkAddressPostalCode)];
|
||||||
|
if (value)
|
||||||
|
[adr setValue: 5 to: value];
|
||||||
|
value = [properties objectForKey: MAPIPropertyKey (PidLidWorkAddressCountry)];
|
||||||
|
if (value)
|
||||||
|
[adr setValue: 6 to: value];
|
||||||
|
|
||||||
ASSIGN (content, [newCard versitString]);
|
ASSIGN (content, [newCard versitString]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue