1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

EWS: fix subfolder search on Exchange 2010

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1315 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-29 15:42:07 +00:00
parent 04bf3294bc
commit 1344e4c9bd
2 changed files with 8 additions and 3 deletions

View File

@ -540,11 +540,11 @@ public class EwsExchangeSession extends ExchangeSession {
for (EWSMethod.Item item : findFolderMethod.getResponseItems()) { for (EWSMethod.Item item : findFolderMethod.getResponseItems()) {
Folder folder = buildFolder(parentFolderId.mailbox, item); Folder folder = buildFolder(parentFolderId.mailbox, item);
if (parentFolderPath.length() > 0) { if (parentFolderPath.length() > 0) {
folder.folderPath = parentFolderPath + '/' + item.get(Field.get("urlcompname").getResponseName()); folder.folderPath = parentFolderPath + '/' + item.get(Field.get("folderDisplayName").getResponseName());
} else if (folderIdMap.get(folder.folderId.value) != null) { } else if (folderIdMap.get(folder.folderId.value) != null) {
folder.folderPath = folderIdMap.get(folder.folderId.value); folder.folderPath = folderIdMap.get(folder.folderId.value);
} else { } else {
folder.folderPath = item.get(Field.get("urlcompname").getResponseName()); folder.folderPath = item.get(Field.get("folderDisplayName").getResponseName());
} }
folders.add(folder); folders.add(folder);
if (recursive && folder.hasChildren) { if (recursive && folder.hasChildren) {
@ -777,7 +777,7 @@ public class EwsExchangeSession extends ExchangeSession {
ItemId newItemId = new ItemId(createOrUpdateItemMethod.getResponseItem()); ItemId newItemId = new ItemId(createOrUpdateItemMethod.getResponseItem());
// disable contact picture handling on Exchange 2007 // disable contact picture handling on Exchange 2007
if (!"Exchange2010".equals(serverVersion)) { if ("Exchange2010".equals(serverVersion)) {
// first delete current picture // first delete current picture
if (currentFileAttachment != null) { if (currentFileAttachment != null) {
DeleteAttachmentMethod deleteAttachmentMethod = new DeleteAttachmentMethod(currentFileAttachment.attachmentId); DeleteAttachmentMethod deleteAttachmentMethod = new DeleteAttachmentMethod(currentFileAttachment.attachmentId);

View File

@ -83,6 +83,11 @@ public class TestImap extends AbstractDavMailTestCase {
assertEquals(". OK Authenticated", socketReader.readLine()); assertEquals(". OK Authenticated", socketReader.readLine());
} }
public void testListFolders() throws IOException {
writeLine(". LSUB \"\" \"*\"");
assertEquals(". OK LSUB completed", readFullAnswer("."));
}
public void testSelectInbox() throws IOException { public void testSelectInbox() throws IOException {
writeLine(". SELECT INBOX"); writeLine(". SELECT INBOX");
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer(".")); assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));