From a5d856f8192aed0dbed8bfa41c0d3b8426f0d40b Mon Sep 17 00:00:00 2001 From: mguessan Date: Fri, 8 Jul 2011 21:18:52 +0000 Subject: [PATCH] Caldav: check Depth before search git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1731 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/caldav/CaldavConnection.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/java/davmail/caldav/CaldavConnection.java b/src/java/davmail/caldav/CaldavConnection.java index ca181097..3862e90b 100644 --- a/src/java/davmail/caldav/CaldavConnection.java +++ b/src/java/davmail/caldav/CaldavConnection.java @@ -608,12 +608,14 @@ public class CaldavConnection extends AbstractConnection { List contacts = null; List events = null; List folderList = null; - if (folder.isContact()) { - contacts = session.getAllContacts(folderPath); - } else if (folder.isCalendar()) { - events = session.getAllEvents(folderPath); - if (!folderPath.startsWith("/public")) { - folderList = session.getSubCalendarFolders(folderPath, false); + if (request.getDepth() == 1) { + if (folder.isContact()) { + contacts = session.getAllContacts(folderPath); + } else if (folder.isCalendar()) { + events = session.getAllEvents(folderPath); + if (!folderPath.startsWith("/public")) { + folderList = session.getSubCalendarFolders(folderPath, false); + } } }