From 5cb2c3e9b7e7853ddd6ff880d0fffb3c2dccef5a Mon Sep 17 00:00:00 2001 From: mguessan Date: Tue, 11 Aug 2009 09:14:16 +0000 Subject: [PATCH] Caldav: additional patch for Outlook created recurring events git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@663 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 12 +++++++----- src/java/timezones.properties | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index 28afce3a..10da8774 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1573,7 +1573,9 @@ public class ExchangeSession { hasAttendee = true; } else if ("TRANSP".equals(key)) { transp = value; - } else if (line.startsWith("TZID:(GMT")) { + } else if (line.startsWith("TZID:(GMT") || + // additional test for Outlook created recurring events + line.startsWith("TZID:GMT ")) { try { validTimezoneId = ResourceBundle.getBundle("timezones").getString(value); } catch (MissingResourceException mre) { @@ -1602,7 +1604,7 @@ public class ExchangeSession { continue; } // fix invalid exchange timezoneid - if (validTimezoneId != null && line.indexOf(";TZID=\"") >= 0) { + if (validTimezoneId != null && line.indexOf(";TZID=") >= 0) { line = fixTimezoneId(line, validTimezoneId); } if (!fromServer && currentAllDayState.isAllDay && "X-MICROSOFT-CDO-ALLDAYEVENT:FALSE".equals(line)) { @@ -1674,10 +1676,10 @@ public class ExchangeSession { } protected String fixTimezoneId(String line, String validTimezoneId) { - int startIndex = line.indexOf("TZID=\""); - int endIndex = line.indexOf('"', startIndex + 6); + int startIndex = line.indexOf("TZID="); + int endIndex = line.indexOf(':', startIndex + 5); if (startIndex >= 0 && endIndex >= 0) { - return line.substring(0, startIndex + 5) + validTimezoneId + line.substring(endIndex + 1); + return line.substring(0, startIndex + 5) + validTimezoneId + line.substring(endIndex); } else { return line; } diff --git a/src/java/timezones.properties b/src/java/timezones.properties index da1079ba..86f6117f 100644 --- a/src/java/timezones.properties +++ b/src/java/timezones.properties @@ -72,3 +72,4 @@ (GMT-10.00)\ Hawaii=Pacific/Honolulu (GMT-11.00)\ Midway Island/Samoa=Pacific/Pago_Pago (GMT-12.00)\ Eniwetok/Kwajalein/Dateline Time=Pacific/Kwajalein +GMT\ +0100\ (Standard)\ /\ GMT\ +0200\ (Daylight)=Europe/Paris