mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-13 14:38:08 -05:00
LDAP: improve iCal autocomplete performance: do not lookup details
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@462 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
69cc508651
commit
119f224de6
@ -639,6 +639,7 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
*/
|
*/
|
||||||
protected void sendPersons(int currentMessageId, String baseContext, Map<String, Map<String, String>> persons, Set<String> returningAttributes) throws IOException {
|
protected void sendPersons(int currentMessageId, String baseContext, Map<String, Map<String, String>> persons, Set<String> returningAttributes) throws IOException {
|
||||||
boolean needObjectClasses = returningAttributes.contains("objectclass") || returningAttributes.size() == 0;
|
boolean needObjectClasses = returningAttributes.contains("objectclass") || returningAttributes.size() == 0;
|
||||||
|
boolean iCalSearch = returningAttributes.contains("apple-serviceslocator");
|
||||||
boolean returnAllAttributes = returningAttributes.size() == 0;
|
boolean returnAllAttributes = returningAttributes.size() == 0;
|
||||||
for (Map<String, String> person : persons.values()) {
|
for (Map<String, String> person : persons.values()) {
|
||||||
boolean needDetails = returnAllAttributes;
|
boolean needDetails = returnAllAttributes;
|
||||||
@ -650,6 +651,10 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// iCal search, do not lookup details
|
||||||
|
if (iCalSearch) {
|
||||||
|
needDetails = false;
|
||||||
|
}
|
||||||
|
|
||||||
// add detailed information
|
// add detailed information
|
||||||
if (needDetails) {
|
if (needDetails) {
|
||||||
@ -671,6 +676,11 @@ public class LdapConnection extends AbstractConnection {
|
|||||||
ldapPerson.put(ldapAttribute, value);
|
ldapPerson.put(ldapAttribute, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// iCal: copy cn to sn
|
||||||
|
if (iCalSearch && ldapPerson.get("cn") != null) {
|
||||||
|
ldapPerson.put("sn", ldapPerson.get("cn"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Process all attributes which have static mappings
|
// Process all attributes which have static mappings
|
||||||
for (Map.Entry<String, String> entry : STATIC_ATTRIBUTE_MAP.entrySet()) {
|
for (Map.Entry<String, String> entry : STATIC_ATTRIBUTE_MAP.entrySet()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user