1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-02-28 09:21:49 -05:00

EWS: Fix 3407395, do not set mailbox on FolderIds returned by Exchange

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1795 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-09-23 08:37:23 +00:00
parent 0ecb6a6def
commit b012b22214
2 changed files with 7 additions and 8 deletions

View File

@ -832,9 +832,9 @@ public class EwsExchangeSession extends ExchangeSession {
FOLDER_PROPERTIES.add(Field.get("highestUid"));
}
protected Folder buildFolder(String mailbox, EWSMethod.Item item) {
protected Folder buildFolder(EWSMethod.Item item) {
Folder folder = new Folder();
folder.folderId = new FolderId(mailbox, item);
folder.folderId = new FolderId(item);
folder.displayName = item.get(Field.get("folderDisplayName").getResponseName());
folder.folderClass = item.get(Field.get("folderclass").getResponseName());
folder.etag = item.get(Field.get("lastmodified").getResponseName());
@ -870,7 +870,7 @@ public class EwsExchangeSession extends ExchangeSession {
BaseShape.ID_ONLY, parentFolderId, FOLDER_PROPERTIES, (SearchExpression) condition);
executeMethod(findFolderMethod);
for (EWSMethod.Item item : findFolderMethod.getResponseItems()) {
Folder folder = buildFolder(parentFolderId.mailbox, item);
Folder folder = buildFolder(item);
if (parentFolderPath.length() > 0) {
folder.folderPath = parentFolderPath + '/' + item.get(Field.get("folderDisplayName").getResponseName());
} else if (folderIdMap.get(folder.folderId.value) != null) {
@ -900,7 +900,7 @@ public class EwsExchangeSession extends ExchangeSession {
EWSMethod.Item item = getFolderMethod.getResponseItem();
Folder folder;
if (item != null) {
folder = buildFolder(folderId.mailbox, item);
folder = buildFolder(item);
folder.folderPath = folderPath;
} else {
throw new HttpNotFoundException("Folder " + folderPath + " not found");
@ -1942,7 +1942,7 @@ public class EwsExchangeSession extends ExchangeSession {
executeMethod(findFolderMethod);
EWSMethod.Item item = findFolderMethod.getResponseItem();
if (item != null) {
folderId = new FolderId(parentFolderId.mailbox, item);
folderId = new FolderId(item);
}
return folderId;
}

View File

@ -56,11 +56,10 @@ public class FolderId extends Option {
/**
* Build Folder id from response item.
*
* @param mailbox mailbox name
* @param item response item
*/
public FolderId(String mailbox, EWSMethod.Item item) {
this("t:FolderId", item.get("FolderId"), item.get("ChangeKey"), mailbox);
public FolderId(EWSMethod.Item item) {
this("t:FolderId", item.get("FolderId"), item.get("ChangeKey"));
}