go-webdav icon indicating copy to clipboard operation
go-webdav copied to clipboard

return a nil CalendarCompRequest when empty

Open kwo opened this issue 5 years ago • 5 comments
trafficstars

Hi. I'm trying to use QueryCalendar with iCloud calendars but cannot do it without these changes. If a CalendarCompRequest if not included in a calendar query, it will be initialized as a blank/empty struct. The code now tests if the CalendarCompRequest is empty and if so returns a nil comp so that the calendarDataReq can be sent properly without a Comp section.

kwo avatar Sep 23 '20 09:09 kwo

The idea looks good to me. Maybe we could instead change the CalendarCompRequest fields to be pointers, but not sure it's worth it.

emersion avatar Oct 12 '20 15:10 emersion

Hmm. Actually, why is CalendarCompRequest.Name not set to VCALENDAR? The RFC seems to indicate that <filter> MUST have a <comp-filter>, and that <comp-filter> MUST have a name attribute.

emersion avatar Oct 13 '20 16:10 emersion

For reference, here's how I've been using QueryCalendar: https://git.sr.ht/~emersion/alps/tree/master/plugins/caldav/routes.go#L104

This package is in dire need of examples.

emersion avatar Oct 13 '20 16:10 emersion

The idea looks good to me. Maybe we could instead change the CalendarCompRequest fields to be pointers, but not sure it's worth it.

That would also work

kwo avatar Oct 27 '20 14:10 kwo

Hmm. Actually, why is CalendarCompRequest.Name not set to VCALENDAR? The RFC seems to indicate that <filter> MUST have a <comp-filter>, and that <comp-filter> MUST have a name attribute.

Thoughts?

emersion avatar Nov 11 '20 09:11 emersion