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:
Wolfgang Sourdeau committed 2011-01-11 17:18:11 +00:00
1 parent 006da94bd5
commit a15f06c844
2 files changed
+43

No files matched your search

@@ -20,6 +20,7 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSValue.h>
@@ -38,6 +39,8 @@
- (void) setMAPIProperties: (NSDictionary *) properties
{
NGVCard *newCard, *oldCard;
NSArray *addresses;
CardElement *adr;
id value;
[self logWithFormat: @"setMAPIProperties: %@", properties];
@@ -66,6 +69,41 @@
if (value)
[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]);
}