caldav: return SupportedComponentSet in PROPFIND
I started using this project to export tasks over CalDav, more
specifically to Reminders on iOS/macOS. I quickly realized that
even if you specify that `SupportedComponentSet` contains `VTODO`, that
isn't reflected properly when doing the `PROPFIND`.
This patch should fix that, while keeping the behaviour of defaulting to
`VEVENT` for propfind. Also added some tests to make sure that I didn't
break anything (Which I hope I didn't 😅).
This commit is contained in:
@@ -525,10 +525,16 @@ func (b *backend) propFindCalendar(ctx context.Context, propfind *internal.PropF
|
||||
}, nil
|
||||
},
|
||||
supportedCalendarComponentSetName: func(*internal.RawXMLValue) (interface{}, error) {
|
||||
components := []comp{}
|
||||
if cal.SupportedComponentSet != nil {
|
||||
for _, name := range cal.SupportedComponentSet {
|
||||
components = append(components, comp{Name: name})
|
||||
}
|
||||
} else {
|
||||
components = append(components, comp{Name: ical.CompEvent})
|
||||
}
|
||||
return &supportedCalendarComponentSet{
|
||||
Comp: []comp{
|
||||
{Name: ical.CompEvent},
|
||||
},
|
||||
Comp: components,
|
||||
}, nil
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user