Skip to content

Commit

Permalink
feat(calendar): Add CALDAV Mac OS X Sonoma (14) support
Browse files Browse the repository at this point in the history
  • Loading branch information
WoodySlum committed Jul 31, 2023
1 parent e0d76fb commit 87bbba0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion SoObjects/Appointments/SOGoAppointmentFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,7 @@ - (NSException *) setDavDescription: (NSString *) description
// FIXME: Improve MacOSX Ventura support
// Check if the problem will be fixed by Apple or if this fix should be kept in the future
// Ticket #5639
if ([[context request] isMacOSXVenturaCalendarApp]) {
if ([[context request] isMacOSXFromVenturaCalendarApp]) {
description = [description stringByReplacingOccurrencesOfString:@"/PERSONAL" withString:@"/personal"];
}

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] isMacOSXFromVenturaCalendarApp] ? [self _davSpecialCalendarURLWithName: @"PERSONAL"] : [self _davSpecialCalendarURLWithName: @"personal"];
}

- (NSArray *) _calendarProxiedUsersWithWriteAccess: (BOOL) write
Expand Down
2 changes: 1 addition & 1 deletion SoObjects/Mailer/SOGoMailAccount.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (void) _appendNamespaces: (NSMutableArray *) folders
// FIXME: Improve MacOSX Ventura support
// Check if the problem will be fixed by Apple or if this fix should be kept in the future
// Ticket #5639
if ([[context request] isMacOSXVenturaCalendarApp]) {
if ([[context request] isMacOSXFromVenturaCalendarApp]) {
namespace = [namespaceDict objectForKey: @"PERSONAL"];
}
if (namespace)
Expand Down
8 changes: 4 additions & 4 deletions SoObjects/SOGo/SOGoGCSFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ + (id) folderWithSubscriptionReference: (NSString *) reference
if ([pathElements count] > 1)
ocsName = [pathElements objectAtIndex: 1];
else
ocsName = [[context request] isMacOSXVenturaCalendarApp] ? @"Personal" : @"personal";
ocsName = [[context request] isMacOSXFromVenturaCalendarApp] ? @"Personal" : @"personal";

path = [NSString stringWithFormat: @"/Users/%@/%@/%@",
login, [pathElements objectAtIndex: 0], ocsName];
Expand Down Expand Up @@ -404,7 +404,7 @@ - (void) setOCSPath: (NSString *) _path
// FIXME: Improve MacOSX Ventura support
// Check if the problem will be fixed by Apple or if this fix should be kept in the future
// Ticket #5639
if ([[context request] isMacOSXVenturaCalendarApp]) {
if ([[context request] isMacOSXFromVenturaCalendarApp]) {
_path = [_path stringByReplacingOccurrencesOfString:@"/PERSONAL" withString:@"/personal"];
}

Expand Down Expand Up @@ -441,7 +441,7 @@ - (GCSFolder *) ocsFolderForPath: (NSString *) _path
// FIXME: Improve MacOSX Ventura support
// Check if the problem will be fixed by Apple or if this fix should be kept in the future
// Ticket #5639
if ([[context request] isMacOSXVenturaCalendarApp]) {
if ([[context request] isMacOSXFromVenturaCalendarApp]) {
_path = [_path stringByReplacingOccurrencesOfString:@"PERSONAL" withString:@"personal"];
}

Expand Down Expand Up @@ -474,7 +474,7 @@ - (NSString *) folderReference
// FIXME: Improve MacOSX Ventura support
// Check if the problem will be fixed by Apple or if this fix should be kept in the future
// Ticket #5639
if ([[context request] isMacOSXVenturaCalendarApp]) {
if ([[context request] isMacOSXFromVenturaCalendarApp]) {
realNameInContainer = [realNameInContainer stringByReplacingOccurrencesOfString:@"PERSONAL" withString:@"personal"];
}

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 [[context request] isMacOSXVenturaCalendarApp] ? @"PERSONAL" : @"Personal";
return [[context request] isMacOSXFromVenturaCalendarApp] ? @"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] isMacOSXFromVenturaCalendarApp] ? @"PERSONAL" : @"personal";
folder = [subFolderClass objectWithName: folderName inContainer: self];
[folder setDisplayName: [self defaultFolderName]];
[folder setOCSPath: [NSString stringWithFormat: @"%@/%@", OCSPath, folderName]];
Expand Down Expand Up @@ -224,7 +224,7 @@ - (NSException *) fetchSpecialFolders: (NSString *) sql
// FIXME: Improve MacOSX Ventura support
// Check if the problem will be fixed by Apple or if this fix should be kept in the future
// Ticket #5639
if ([[context request] isMacOSXVenturaCalendarApp]) {
if ([[context request] isMacOSXFromVenturaCalendarApp]) {
if ([key isEqualToString:@"personal"]) {
key = @"PERSONAL";
}
Expand Down
2 changes: 1 addition & 1 deletion SoObjects/SOGo/SOGoUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,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] isMacOSXFromVenturaCalendarApp] ? @"PERSONAL" : @"personal"
ignoringRights: YES];
}

Expand Down
1 change: 1 addition & 0 deletions SoObjects/SOGo/WORequest+SOGo.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- (BOOL)isMacOSXCalendarApp;
- (BOOL)isIPhoneAddressBookApp;
- (BOOL) isAndroid;
- (BOOL)isMacOSXFromVenturaCalendarApp,

@end

Expand Down
5 changes: 3 additions & 2 deletions SoObjects/SOGo/WORequest+SOGo.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ - (BOOL) isAndroid
return ([[cc userAgent] rangeOfString: @"Android"].location != NSNotFound);
}

- (BOOL) isMacOSXVenturaCalendarApp
- (BOOL) isMacOSXFromVenturaCalendarApp
{
WEClientCapabilities *cc;
BOOL b;
Expand All @@ -251,7 +251,8 @@ - (BOOL) isMacOSXVenturaCalendarApp

b = (
(
nil != [cc userAgent] && [[cc userAgent] rangeOfString: @"macOS/13"].location != NSNotFound
nil != [cc userAgent]
&& ([[cc userAgent] rangeOfString: @"macOS/13"].location != NSNotFound || [[cc userAgent] rangeOfString: @"macOS/14"].location != NSNotFound)
&& [[cc userAgent] rangeOfString: @"dataaccessd"].location != NSNotFound
)
);
Expand Down

0 comments on commit 87bbba0

Please sign in to comment.