From 3a78a3bbb44484c95c141b0f3c0c8fabdc8bcf6a Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Tue, 9 Jun 2026 10:26:58 +0200 Subject: [PATCH] fix(calendar): do not transmit og http status to external calendar --- .../Appointments/SOGoWebAppointmentFolder.m | 4 ++++ UI/Scheduler/UIxCalFolderActions.m | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/SoObjects/Appointments/SOGoWebAppointmentFolder.m b/SoObjects/Appointments/SOGoWebAppointmentFolder.m index d6dfe6f0b..779aa0687 100644 --- a/SoObjects/Appointments/SOGoWebAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoWebAppointmentFolder.m @@ -184,6 +184,10 @@ size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *buffer) else [result setObject: @"invalid-calendar-content" forKey: @"error"]; } + else if (status == 401) + { + [result setObject: @"need-auth" forKey: @"error"]; + } else [result setObject: @"http-error" forKey: @"error"]; } diff --git a/UI/Scheduler/UIxCalFolderActions.m b/UI/Scheduler/UIxCalFolderActions.m index 572e65afa..0bb73a79d 100644 --- a/UI/Scheduler/UIxCalFolderActions.m +++ b/UI/Scheduler/UIxCalFolderActions.m @@ -148,14 +148,26 @@ */ - (WOResponse *) reloadAction { - NSDictionary *results; + NSMutableDictionary *results; + NSString *error; unsigned int httpCode; httpCode = 200; results = [[self clientObject] loadWebCalendar]; + if ([results objectForKey: @"status"]) - httpCode = [[results objectForKey: @"status"] intValue]; + { + if ([results objectForKey: @"error"]) + { + error = [results objectForKey: @"error"]; + if ([error isEqualToString: @"need-auth"]) + httpCode = 401; + if ([error isEqualToString: @"invalid-calendar-content"] || [error isEqualToString: @"http-error"]) + httpCode = 500; + } + [results removeObjectForKey:@"status"]; + } return [self responseWithStatus: httpCode andJSONRepresentation: results]; }