DAV: fix regression 3020385 on folder handling

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1105 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-06-23 22:27:42 +00:00
parent 0b5968a7c8
commit 94df7b45d8
2 changed files with 6 additions and 4 deletions

View File

@ -1135,7 +1135,7 @@ public class DavExchangeSession extends ExchangeSession {
@Override
public MessageList searchMessages(String folderPath, List<String> attributes, Condition condition) throws IOException {
MessageList messages = new MessageList();
MultiStatusResponse[] responses = searchItems(folderPath, attributes, condition, FolderQueryTraversal.Shallow);
MultiStatusResponse[] responses = searchItems(folderPath, attributes, and(isFalse("isfolder"),condition), FolderQueryTraversal.Shallow);
for (MultiStatusResponse response : responses) {
Message message = buildMessage(response);
@ -1152,7 +1152,7 @@ public class DavExchangeSession extends ExchangeSession {
@Override
protected List<ExchangeSession.Contact> searchContacts(String folderPath, List<String> attributes, Condition condition) throws IOException {
List<ExchangeSession.Contact> contacts = new ArrayList<ExchangeSession.Contact>();
MultiStatusResponse[] responses = searchItems(folderPath, attributes, condition, FolderQueryTraversal.Shallow);
MultiStatusResponse[] responses = searchItems(folderPath, attributes, and(isFalse("isfolder"),condition), FolderQueryTraversal.Shallow);
for (MultiStatusResponse response : responses) {
contacts.add(new Contact(response));
}
@ -1162,7 +1162,7 @@ public class DavExchangeSession extends ExchangeSession {
@Override
protected List<ExchangeSession.Event> searchEvents(String folderPath, List<String> attributes, Condition condition) throws IOException {
List<ExchangeSession.Event> events = new ArrayList<ExchangeSession.Event>();
MultiStatusResponse[] responses = searchItems(folderPath, attributes, condition, FolderQueryTraversal.Shallow);
MultiStatusResponse[] responses = searchItems(folderPath, attributes, and(isFalse("isfolder"),condition), FolderQueryTraversal.Shallow);
for (MultiStatusResponse response : responses) {
String instancetype = getPropertyIfExists(response.getProperties(HttpStatus.SC_OK), "instancetype");
Event event = new Event(response);
@ -1196,7 +1196,7 @@ public class DavExchangeSession extends ExchangeSession {
}
}
searchRequest.append(" FROM SCOPE('").append(folderQueryTraversal).append(" TRAVERSAL OF \"").append(folderUrl).append("\"')")
.append(" WHERE \"DAV:ishidden\" = False AND \"DAV:isfolder\" = False");
.append(" WHERE \"DAV:ishidden\" = False");
if (condition != null) {
searchRequest.append(" AND ");
condition.appendTo(searchRequest);

View File

@ -109,6 +109,8 @@ public class Field {
createField(URN_SCHEMAS_HTTPMAIL, "unreadcount");
createField(SCHEMAS_REPL, "contenttag");
createField(DAV, "isfolder");
// POP and IMAP message
createField(DAV, "uid");
createField("messageSize", 0x0e08, PropertyType.Integer);//PR_MESSAGE_SIZE