From 560c1dcd82359c7fe8ccbb985d122e532c594df9 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 20 Jan 2020 12:03:34 -0500 Subject: [PATCH] fix(calendar): adjust recurrent rule when importing a vEvent --- SoObjects/Appointments/iCalEvent+SOGo.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/SoObjects/Appointments/iCalEvent+SOGo.m b/SoObjects/Appointments/iCalEvent+SOGo.m index 79983fc57..005dd2a36 100644 --- a/SoObjects/Appointments/iCalEvent+SOGo.m +++ b/SoObjects/Appointments/iCalEvent+SOGo.m @@ -536,6 +536,23 @@ [self errorWithFormat: @"Broken all-day event; setting end date to %@ for UID %@", [self endDate], [self uid]]; } + if ([self isRecurrent]) + { + NSArray *rules; + iCalRecurrenceRule *rule; + + rules = [self recurrenceRules]; + if ([rules count] > 0) + { + // Consider first rule only + rule = [rules objectAtIndex: 0]; + if ([rule repeatCount] && [rule untilDate]) + { + [self errorWithFormat: @"Recurrent event with both repeat count (%i) and until date (%@); dropping until date", [rule repeatCount], [rule untilDate]]; + [rule setUntil: nil]; + } + } + } return timezone;