Search code examples
icloudwebdavicalendarcaldav

How to remove duplicate event entires from Caldav client for iCloud calendar


I am working on a Caldav client for iCloud Calendar. When we request for the list of calendars there are few calendars as follows which are not visible in the iCloud interface.

/calendars/notification/, /calendars/tasks/, /calendars/inbox/

Along with normal calendars like.

/calendars/home/, /calendars/work/

The issue is some events in home calendar are duplicated in inbox calendar also. To create this case invite someone to an event, So this event will appear in his home calendar and inbox calendar.

How can we remove these duplicate entries. Can we ignore such calendars, if yes how to get the list of invisible calendars?

Thanks


Solution

  • When issuing your PRPOPFIND request, you should ask for the DAV:resourcetype property. In the response from the server, proper calendars will have a CALDAV:calendar subelement in this property (see https://www.rfc-editor.org/rfc/rfc4791#section-4.2) whereas the inbox will have a CALDAV:schedule-inbox subelement (see https://www.rfc-editor.org/rfc/rfc6638#section-2.2 ) and the notification one is likely to have yet another value.

    The task calendar is probably a real calendar containing VTODOs.

    As far as the "duplicate events", those are not actual CalDAV calendar resources but rather iTIP Messages (invitations but also replies and cancel messages). You can use them to notify your user that he has received an invitation or that an attendee has replied to an invitation he had sent.