From 6016ae3b08f3cb99357888572936fe9e33a7125d Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 15 Dec 2008 21:32:32 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 938ae259405463bbb24b4b86379a0b522a69961c Monotone-Revision: 6411d6bcaaaa5245d22397cfde490125a116e0c7 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-12-15T21:32:32 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++++- SoObjects/Contacts/SOGoContactLDIFEntry.m | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) 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