From 3c400b36645fa5ba7e0864ca93cb5c672b1c9550 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 2 Apr 2018 12:18:49 +0200 Subject: [PATCH] Ignore cancelled events --- src/calanonsync/calanonsync.go | 2 +- src/calanonsync/ews.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calanonsync/calanonsync.go b/src/calanonsync/calanonsync.go index 953001a..c03073d 100644 --- a/src/calanonsync/calanonsync.go +++ b/src/calanonsync/calanonsync.go @@ -25,7 +25,7 @@ func main() { for _, item := range items { // Ignore private items. - if item.Sensitivity != "Private" { + if item.Sensitivity != "Private" && !item.IsCancelled { // None-private items though ... remember them by hash. // The hash will equal the CalDAV UID (and its filename). relevantEWSItems[item.Hash()] = item diff --git a/src/calanonsync/ews.go b/src/calanonsync/ews.go index 74f4941..b328f7d 100644 --- a/src/calanonsync/ews.go +++ b/src/calanonsync/ews.go @@ -27,6 +27,8 @@ type CalendarItem struct { RecurrenceId string Sensitivity string CalendarItemType string + IsCancelled bool + IsAllDayEvent bool } // Build a hash for the given calendar item by combining the UID and @@ -206,7 +208,7 @@ var calendarQuery = template.Must(template.New("calendarQuery").Parse(` - +