diff --git a/ChangeLog b/ChangeLog index 12345fcd8..6866af4ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,11 @@ * Updated german translations - patch from Alexander Greiner-Baer - + * SoObjects/Contacts/SOGoContactLDIFEntry.m + ([SOGoContactLDIFEntry -vCard]): We now force + the usage of the SOGoLDAPContactInfoAttribute, + if defined, over "description" when generating + the "NOTE" attribute. 2008-12-14 Ludovic Marcotte diff --git a/SoObjects/Contacts/SOGoContactLDIFEntry.m b/SoObjects/Contacts/SOGoContactLDIFEntry.m index 0d0dba027..412257000 100644 --- a/SoObjects/Contacts/SOGoContactLDIFEntry.m +++ b/SoObjects/Contacts/SOGoContactLDIFEntry.m @@ -23,6 +23,7 @@ #import #import #import +#import #import #import @@ -113,7 +114,7 @@ - (NGVCard *) vCard { - NSString *info, *surname, *streetAddress, *location; + NSString *info, *surname, *streetAddress, *location, *key; CardElement *element; unsigned int count; @@ -141,9 +142,20 @@ info = [ldifEntry objectForKey: @"mozillaNickname"]; if (info) [vcard setNickname: info]; - info = [ldifEntry objectForKey: @"description"]; + + // If SOGoLDAPContactInfoAttribute is defined, we set it + // as the NOTE value in order for Thunderbird (or any other + // CardDAV client) to display it. + key = [[NSUserDefaults standardUserDefaults] + stringForKey: @"SOGoLDAPContactInfoAttribute"]; + + if (!key) + key = @"description"; + + info = [ldifEntry objectForKey: key]; if (info) [vcard setNote: info]; + info = [ldifEntry objectForKey: @"mail"]; if (info) [vcard addEmail: info