LDAP: copy uid to apple-generateduid for iCal attendee search

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@714 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-09-10 13:20:55 +00:00
parent c434a5dace
commit 736437670a
1 changed files with 6 additions and 2 deletions

View File

@ -786,17 +786,21 @@ public class LdapConnection extends AbstractConnection {
} }
} }
} else { } else {
// iCal: copy uid to apple-generateduid
if (returningAttributes.contains("apple-generateduid") && person.get("uid") != null) {
person.put("apple-generateduid", person.get("uid"));
}
// convert Contact entries // convert Contact entries
for (Map.Entry<String, String> entry : person.entrySet()) { for (Map.Entry<String, String> entry : person.entrySet()) {
String contactAttribute = entry.getKey(); String contactAttribute = entry.getKey();
// get converted attribute name // get converted attribute name
String ldapAttribute = CONTACT_ATTRIBUTE_MAP.get(contactAttribute); String ldapAttribute = CONTACT_ATTRIBUTE_MAP.get(contactAttribute);
// no conversion, use exchange attribute name // no conversion, use exchange attribute name
if (ldapAttribute == null){ if (ldapAttribute == null) {
ldapAttribute = contactAttribute; ldapAttribute = contactAttribute;
} }
String value = entry.getValue(); String value = entry.getValue();
if (value != null if (value != null
&& (returnAllAttributes || returningAttributes.contains(ldapAttribute.toLowerCase()))) { && (returnAllAttributes || returningAttributes.contains(ldapAttribute.toLowerCase()))) {
ldapPerson.put(ldapAttribute, value); ldapPerson.put(ldapAttribute, value);
} }