fix(calendar): Fix duplicates in series appointments for Apple's Calendar

This commit is contained in:
smizrahi
2023-07-11 15:26:31 +02:00
parent a48440754c
commit 7600e9e179
3 changed files with 12 additions and 5 deletions
+6 -2
View File
@@ -124,8 +124,10 @@
if(!IS_EQUAL([_from created], [_to created], isEqualToDate:))
[updatedProperties addObject:@"created"];
if(!IS_EQUAL([_from lastModified], [_to lastModified], isEqualToDate:))
[updatedProperties addObject:@"lastModified"];
if(![_from durationAsTimeInterval] == [_to durationAsTimeInterval])
[updatedProperties addObject:@"timeStampAsDate"];
if(!IS_EQUAL([_from timeStampAsDate], [_to timeStampAsDate], isEqualToDate:))
[updatedProperties addObject:@"timeStampAsDate"];
if([_from durationAsTimeInterval] != [_to durationAsTimeInterval])
[updatedProperties addObject:@"duration"];
if(!IS_EQUAL([_from summary], [_to summary], isEqualToString:))
[updatedProperties addObject:@"summary"];
@@ -145,6 +147,8 @@
[updatedProperties addObject:@"organizer"];
if(!IS_EQUAL([_from recurrenceRules], [_to recurrenceRules], isEqual:))
[updatedProperties addObject:@"rrule"];
if(!IS_EQUAL([_from recurrenceId], [_to recurrenceId], isEqualToDate:))
[updatedProperties addObject:@"rid"];
if(!IS_EQUAL([_from exceptionRules], [_to exceptionRules], isEqual:))
[updatedProperties addObject:@"exrule"];
if(!IS_EQUAL([_from exceptionDates], [_to exceptionDates], isEqual:))
@@ -191,11 +191,13 @@
iCalCalendar *iCalendarToSave;
iCalPerson *attendee;
SOGoUser *user;
WORequest *rq;
iCalendarToSave = nil;
user = [SOGoUser userWithLogin: theUID];
attendeeObject = [self _lookupEvent: [newEvent uid] forUID: theUID];
attendee = [newEvent userAsAttendee: user];
rq = [context request];
// If the atttende's role is NON-PARTICIPANT, we write nothing to its calendar
if ([[attendee role] caseInsensitiveCompare: @"NON-PARTICIPANT"] == NSOrderedSame)
@@ -217,8 +219,9 @@
return;
}
if ([newEvent recurrenceId])
if ([newEvent recurrenceId] && ![rq isICal4] && ![rq isICal])
{
// We must add an occurence to a non-existing event.
if ([attendeeObject isNew])
@@ -30,7 +30,7 @@
static NSString *properties[] = {@"organizer", @"startDate", @"endDate",
@"due", @"duration", @"summary",
@"rdate", @"rrule", @"exdate", @"exrule",
@"status", @"location",
@"status", @"location", @"rid", @"timeStampAsDate",
nil};
NSString **currentProperty;
BOOL updateRequired;