From 6ee8f764e95c375b2f6a388b3e8b24c28ca6e9f5 Mon Sep 17 00:00:00 2001 From: smizrahi Date: Tue, 13 Dec 2022 11:08:43 +0100 Subject: [PATCH] fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639 --- .../Appointments/SOGoAppointmentFolder.h | 3 +++ .../Appointments/SOGoAppointmentFolder.m | 21 ++++++++++++++++++- SoObjects/SOGo/SOGoObject.m | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.h b/SoObjects/Appointments/SOGoAppointmentFolder.h index 4ebde6280..cfae7e2f5 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.h +++ b/SoObjects/Appointments/SOGoAppointmentFolder.h @@ -195,6 +195,9 @@ typedef enum { startDate: (NSCalendarDate **) theStartDate endDate: (NSCalendarDate **) theEndDate; +- (void) setDavDescription:(NSString *)description; +- (NSString *) davDescription; + @end #endif /* __Appointments_SOGoAppointmentFolder_H__ */ diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 2c4380081..935ade494 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2038,6 +2038,13 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir { NSException *error; NSString *realColor; + + if ([newColor length] == 7 + && [newColor hasPrefix: @"#"]) + { + // Missing alpha channel + newColor = [newColor stringByAppendingString: @"FF"]; + } if ([newColor length] == 9 && [newColor hasPrefix: @"#"]) @@ -2584,9 +2591,21 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir return componentSet; } +- (void) setDavDescription: (NSString *) description +{ + [self setFolderPropertyValue: description + inCategory: @"DavDescription"]; +} + - (NSString *) davDescription { - return @""; + NSString *davDescription; + + davDescription = [self folderPropertyValueInCategory: @"DavDescription"]; + if (!davDescription) + davDescription = @""; + + return davDescription; } /* diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 277b9d8ca..1ea37ee78 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -1551,6 +1551,9 @@ currentValue = [setProps objectForKey: currentProp]; exception = [self performSelector: methodSel withObject: currentValue]; + if (![exception isKindOfClass: [NSException class]]) { + exception = nil; + } } else exception = [NSException exceptionWithDAVStatus: 403