Ignore cancelled events

This commit is contained in:
Andreas Schneider 2018-04-02 12:18:49 +02:00
parent a20a9040b6
commit 3c400b3664
2 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,7 @@ func main() {
for _, item := range items { for _, item := range items {
// Ignore private items. // Ignore private items.
if item.Sensitivity != "Private" { if item.Sensitivity != "Private" && !item.IsCancelled {
// None-private items though ... remember them by hash. // None-private items though ... remember them by hash.
// The hash will equal the CalDAV UID (and its filename). // The hash will equal the CalDAV UID (and its filename).
relevantEWSItems[item.Hash()] = item relevantEWSItems[item.Hash()] = item

View File

@ -27,6 +27,8 @@ type CalendarItem struct {
RecurrenceId string RecurrenceId string
Sensitivity string Sensitivity string
CalendarItemType string CalendarItemType string
IsCancelled bool
IsAllDayEvent bool
} }
// Build a hash for the given calendar item by combining the UID and // 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(`<?xml ver
<t:FieldURI FieldURI="calendar:RecurrenceId" /> <t:FieldURI FieldURI="calendar:RecurrenceId" />
<t:FieldURI FieldURI="calendar:IsCancelled" /> <t:FieldURI FieldURI="calendar:IsCancelled" />
<t:FieldURI FieldURI="calendar:CalendarItemType" /> <t:FieldURI FieldURI="calendar:CalendarItemType" />
<t:FieldURI FieldURI="calendar:CalendarItemType" /> <t:FieldURI FieldURI="calendar:IsAllDayEvent" />
</t:AdditionalProperties> </t:AdditionalProperties>
</m:ItemShape> </m:ItemShape>
<m:CalendarView StartDate="{{ .StartDate }}" EndDate="{{ .EndDate }}" /> <m:CalendarView StartDate="{{ .StartDate }}" EndDate="{{ .EndDate }}" />