CalDAVClient
CalDAVClient copied to clipboard
Add $depth parameter in getCalendar request
This allows the user to retrieve all the objects in the calendar.
This is the (I believe) only 'proper' way to get a list of all the objects in a calendar. This is the way that the Mac Calendar app does it. I checked by installing mitmproxy and observing the requests.
You can do a filter query too, but then recurring events are probably included more than once (I think), and you can't be sure that you have everything. You can obviously set humongous time ranges (say 1-1-1800 to 1-1-2200), but that's code smell and I don't like code smell.
Unfortunately, this means that the getCalendarResponse is now a multiresponse (as it implicitly already was), so any existing code might break. The alternative is to keep it as a fake single response as to not break any code, and to introduce a new class to cover this use case, but that's probably code smell as well...
I thought this worked, but it didn't. Apologies. I didn't add the 'multiresponse' layer that was necessary; without it my GetCalendars() calls would come back empty.
ok no problem i will take a look asap thx ! :)
Code was still broken, but I got the tests running on my machine. However, that was before Github told me there's a merge conflict with the master branch - which I resolved in the browser, so I couldn't test if the tests are still running. Think they will, though (it was only a minor change)