feat(calendar): Add CALDAV Mac OS X Sonoma (14) support

This commit is contained in:
smizrahi
2023-07-31 09:15:07 +02:00
parent e0d76fba65
commit 87bbba0c8d
8 changed files with 15 additions and 13 deletions

View File

@@ -2612,7 +2612,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
// 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"];
}

View File

@@ -190,7 +190,7 @@
- (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

View File

@@ -139,7 +139,7 @@ static NSString *inboxFolderName = @"INBOX";
// 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)

View File

@@ -150,7 +150,7 @@ static NSArray *childRecordFields = nil;
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];
@@ -404,7 +404,7 @@ static NSArray *childRecordFields = nil;
// 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"];
}
@@ -441,7 +441,7 @@ static NSArray *childRecordFields = nil;
// 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"];
}
@@ -474,7 +474,7 @@ static NSArray *childRecordFields = nil;
// 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"];
}

View File

@@ -144,7 +144,7 @@ static SoSecurityManager *sm = nil;
- (NSString *) defaultFolderName
{
return [[context request] isMacOSXVenturaCalendarApp] ? @"PERSONAL" : @"Personal";
return [[context request] isMacOSXFromVenturaCalendarApp] ? @"PERSONAL" : @"Personal";
}
- (NSString *) collectedFolderName
@@ -173,7 +173,7 @@ static SoSecurityManager *sm = nil;
{
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]];
@@ -224,7 +224,7 @@ static SoSecurityManager *sm = nil;
// 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";
}

View File

@@ -1060,7 +1060,7 @@
- (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];
}

View File

@@ -36,6 +36,7 @@
- (BOOL)isMacOSXCalendarApp;
- (BOOL)isIPhoneAddressBookApp;
- (BOOL) isAndroid;
- (BOOL)isMacOSXFromVenturaCalendarApp,
@end

View File

@@ -242,7 +242,7 @@
return ([[cc userAgent] rangeOfString: @"Android"].location != NSNotFound);
}
- (BOOL) isMacOSXVenturaCalendarApp
- (BOOL) isMacOSXFromVenturaCalendarApp
{
WEClientCapabilities *cc;
BOOL b;
@@ -251,7 +251,8 @@
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
)
);