Commit 3cb78899 authored by Mickaël Guessant's avatar Mickaël Guessant

Caldav: make sure retrieved item name is always the same as requested item...

Caldav: make sure retrieved item name is always the same as requested item name (e.g. for tasks stored value ends with .EML when requested value ends with .ics)

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2454 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent 0a3ff4b9
......@@ -2340,6 +2340,10 @@ public abstract class ExchangeSession {
public String getHref() {
return folderPath + '/' + itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
}
/**
......
......@@ -2068,9 +2068,10 @@ public class EwsExchangeSession extends ExchangeSession {
if (item == null && isMainCalendar(folderPath)) {
// look for item in task folder, replace extension first
if (itemName.endsWith(".ics")) {
itemName = itemName.substring(0, itemName.length() - 3) + "EML";
item = getEwsItem(TASKS, itemName.substring(0, itemName.length() - 3) + "EML");
} else {
item = getEwsItem(TASKS, itemName);
}
item = getEwsItem(TASKS, itemName);
}
if (item == null) {
......@@ -2096,7 +2097,10 @@ public class EwsExchangeSession extends ExchangeSession {
|| "Task".equals(itemType)
// VTODOs appear as Messages
|| "Message".equals(itemType)) {
return new Event(folderPath, item);
Event event = new Event(folderPath, item);
// force item name to client provided name (for tasks)
event.setItemName(itemName);
return event;
} else {
throw new HttpNotFoundException(itemName + " not found in " + folderPath);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment