Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return a nil CalendarCompRequest when empty #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

return a nil CalendarCompRequest when empty #44

wants to merge 1 commit into from

Conversation

kwo
Copy link

@kwo kwo commented Sep 23, 2020

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.

caldav/caldav.go Outdated Show resolved Hide resolved
@emersion
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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.

necessary to work with iCloud

# Conflicts:
#	caldav/caldav_test.go
#	caldav/client.go
@kwo
Copy link
Author

kwo commented Oct 27, 2020

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

@emersion
Copy link
Owner

emersion commented Nov 11, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants