From 0649996caf676cd7f289fc5c70f404490fdf09f9 Mon Sep 17 00:00:00 2001 From: mguessan Date: Fri, 1 Oct 2010 21:26:55 +0000 Subject: [PATCH] Caldav: use i18n calendar name as display name for iCal git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1488 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/caldav/CaldavConnection.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/java/davmail/caldav/CaldavConnection.java b/src/java/davmail/caldav/CaldavConnection.java index 07c99175..8aabb2e8 100644 --- a/src/java/davmail/caldav/CaldavConnection.java +++ b/src/java/davmail/caldav/CaldavConnection.java @@ -437,7 +437,12 @@ public class CaldavConnection extends AbstractConnection { } if (request.hasProperty("displayname")) { if (subFolder == null || subFolder.length() == 0) { - response.appendProperty("D:displayname", request.getLastPath()); + // use i18n calendar name as display name + String displayname = request.getLastPath(); + if ("calendar".equals(displayname)) { + displayname = folder.displayName; + } + response.appendProperty("D:displayname", displayname); } else { response.appendProperty("D:displayname", subFolder); } @@ -638,7 +643,7 @@ public class CaldavConnection extends AbstractConnection { public void patchCalendar(CaldavRequest request) throws IOException { String displayname = request.getProperty("displayname"); String folderPath = request.getFolderPath(); - if (displayname != null && !folderPath.equalsIgnoreCase("/users/"+session.getEmail()+"/calendar")) { + if (displayname != null && !folderPath.equalsIgnoreCase("/users/" + session.getEmail() + "/calendar")) { String targetPath = request.getParentFolderPath() + '/' + displayname; if (!targetPath.equals(folderPath)) { session.moveFolder(folderPath, targetPath);