From 457fccd5ac9f000f1125ba91266a268b626573c3 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 21 Dec 2016 11:43:08 -0500 Subject: [PATCH] (fix) append .ics extension if not present when importing events (fixes #2308) --- SoObjects/Appointments/SOGoAppointmentFolder.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 776c42c795..cbe3aff486 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -3237,6 +3237,12 @@ - (NSString *) importComponent: (iCalEntityObject *) event } } + // If the UID isn't ending with the ".ics" extension, let's add it to avoid + // confusing broken CalDAV client (like Nokia N9 and Korganizer) that relies + // on this (see #2308) + if (![[uid lowercaseString] hasSuffix: @".ics"]) + uid = [NSString stringWithFormat: @"%@.ics", uid]; + object = [SOGoAppointmentObject objectWithName: uid inContainer: self]; [object setIsNew: YES]; @@ -3400,8 +3406,7 @@ - (int) importCalendar: (iCalCalendar *) calendar timezone: timezone])) { imported++; - [uids setValue: uid - forKey: originalUid]; + [uids setValue: uid forKey: originalUid]; } }