Skip to content

Commit c02b6c3

Browse files
committed
Caldav: append both timezone objects on mixed timezone events
git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@4097 3d1905a2-6b24-0410-a738-b14d5a86fcbd
1 parent 7412f82 commit c02b6c3

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/java/davmail/exchange/graph/GraphExchangeSession.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,15 @@ public byte[] getEventContent() throws IOException {
236236
// set email on vcalendar object for shared calendars
237237
localVCalendar.setEmail(getCalendarEmail(folderPath));
238238
// set timezone based on start date timezone
239-
String originalStarttimezone = graphObject.optString("originalStartTimeZone");
240-
if (originalStarttimezone != null) {
241-
localVCalendar.setTimezone(getVTimezone(originalStarttimezone));
239+
String originalStartTimeZone = graphObject.optString("originalStartTimeZone");
240+
String originalEndTimeZone = graphObject.optString("originalEndTimeZone");
241+
if (originalStartTimeZone != null && !"tzone://Microsoft/Custom".equals(originalStartTimeZone)) {
242+
localVCalendar.setTimezone(getVTimezone(originalStartTimeZone));
243+
// mixed timezone event, append both VTIMEZONE objects
244+
if (originalEndTimeZone != null && !"tzone://Microsoft/Custom".equals(originalEndTimeZone)
245+
&& !originalEndTimeZone.equals(originalStartTimeZone)) {
246+
localVCalendar.setTimezone(getVTimezone(originalEndTimeZone));
247+
}
242248
} else {
243249
localVCalendar.setTimezone(getVTimezone());
244250
}

0 commit comments

Comments
 (0)