Skip to content

Commit

Permalink
fix(calendar): Fix inaccessibility to personal calendar on Mac OS X V…
Browse files Browse the repository at this point in the history
…entura. Fixes #5639
  • Loading branch information
WoodySlum committed Jan 31, 2023
1 parent 7e357f1 commit ba0d4a5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SoObjects/Appointments/SOGoAppointmentFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -2548,7 +2548,7 @@ - (NSArray *) davResourceType
XMLNS_GROUPDAV, nil];
[colType addObject: gdVTodoCol];
}
if ([nameInContainer isEqualToString: @"personal"] || [nameInContainer isEqualToString: @"Personal"])
if ([[nameInContainer lowercaseString] isEqualToString: @"personal"])
[colType addObject: [NSArray arrayWithObjects: @"schedule-outbox",
XMLNS_CALDAV, nil]];
}
Expand Down
2 changes: 1 addition & 1 deletion SoObjects/Appointments/SOGoUserFolder+Appointments.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ - (NSArray *) davCalendarScheduleInboxURL

- (NSArray *) davCalendarScheduleOutboxURL
{
return [[context request] isMacOSXVenturaCalendarApp] ? [self _davSpecialCalendarURLWithName: @"Personal"] : [self _davSpecialCalendarURLWithName: @"personal"];
return [[context request] isMacOSXVenturaCalendarApp] ? [self _davSpecialCalendarURLWithName: @"PERSONAL"] : [self _davSpecialCalendarURLWithName: @"personal"];
}

- (NSArray *) _calendarProxiedUsersWithWriteAccess: (BOOL) write
Expand Down
6 changes: 3 additions & 3 deletions SoObjects/SOGo/SOGoFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,16 @@ - (NSComparisonResult) _compareByNameInContainer: (SOGoFolder *) otherFolder

selfName = [self realNameInContainer];
otherName = [otherFolder realNameInContainer];
if ([selfName isEqualToString: @"personal"] || [selfName isEqualToString: @"Personal"])
if ([[selfName lowercaseString] isEqualToString: @"personal"])
{
if ([otherName isEqualToString: @"personal"] || [otherName isEqualToString: @"Personal"])
if ([[otherName lowercaseString] isEqualToString: @"personal"])
comparison = NSOrderedSame;
else
comparison = NSOrderedAscending;
}
else
{
if ([otherName isEqualToString: @"personal"] || [otherName isEqualToString: @"Personal"])
if ([[otherName lowercaseString] isEqualToString: @"personal"])
comparison = NSOrderedDescending;
else
comparison = NSOrderedSame;
Expand Down
6 changes: 3 additions & 3 deletions SoObjects/SOGo/SOGoParentFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ - (void) setBaseOCSPath: (NSString *) newOCSPath

- (NSString *) defaultFolderName
{
return @"Personal";
return [[context request] isMacOSXVenturaCalendarApp] ? @"PERSONAL" : @"Personal";
}

- (NSString *) collectedFolderName
Expand Down Expand Up @@ -173,7 +173,7 @@ - (void) createSpecialFolder: (SOGoFolderType) folderType
{
if (folderType == SOGoPersonalFolder)
{
folderName = [[context request] isMacOSXVenturaCalendarApp] ? @"Personal" : @"personal";
folderName = [[context request] isMacOSXVenturaCalendarApp] ? @"PERSONAL" : @"personal";
folder = [subFolderClass objectWithName: folderName inContainer: self];
[folder setDisplayName: [self defaultFolderName]];
[folder setOCSPath: [NSString stringWithFormat: @"%@/%@", OCSPath, folderName]];
Expand Down Expand Up @@ -241,7 +241,7 @@ - (NSException *) fetchSpecialFolders: (NSString *) sql
}
if (folderType == SOGoPersonalFolder)
{
if (![subFolders objectForKey: @"personal"] || ![subFolders objectForKey: @"Personal"])
if (![subFolders objectForKey: @"personal"] || ![subFolders objectForKey: @"Personal"] || ![subFolders objectForKey: @"PERSONAL"])
[self createSpecialFolder: SOGoPersonalFolder];
}
else if (folderType == SOGoCollectedFolder)
Expand Down
2 changes: 1 addition & 1 deletion SoObjects/SOGo/SOGoUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ - (SOGoAppointmentFolders *) calendarsFolderInContext: (WOContext *) context

- (SOGoAppointmentFolder *) personalCalendarFolderInContext: (WOContext *) context
{
return [[self calendarsFolderInContext: context] lookupPersonalFolder: [[context request] isMacOSXVenturaCalendarApp] ? @"Personal" : @"personal"
return [[self calendarsFolderInContext: context] lookupPersonalFolder: [[context request] isMacOSXVenturaCalendarApp] ? @"PERSONAL" : @"personal"
ignoringRights: YES];
}

Expand Down

0 comments on commit ba0d4a5

Please sign in to comment.