fix(calendar): Fix inaccessibility to personal calendar on Mac OS X Ventura. Fixes #5639

This commit is contained in:
smizrahi
2022-12-07 17:57:00 +01:00
parent fe9ae12e46
commit 03e6d0012b
4 changed files with 36 additions and 2 deletions
+6
View File
@@ -431,6 +431,12 @@ static NSArray *childRecordFields = nil;
cache = [SOGoCache sharedCache];
record = [[cache valueForKey: _path] objectFromJSONString];
// 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]) {
_path = [_path stringByReplacingOccurrencesOfString:@"Personal" withString:@"personal"];
}
// We check if we got a cache miss or a potentially bogus
// entry from the cache
+12 -1
View File
@@ -221,10 +221,21 @@ static SoSecurityManager *sm = nil;
while ((row = [fc fetchAttributes: attrs withZone: NULL]))
{
key = [row objectForKey: @"c_path4"];
// 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 ([key isEqualToString:@"personal"]) {
key = @"Personal";
}
}
if ([key isKindOfClass: [NSString class]])
{
folder = [subFolderClass objectWithName: key inContainer: self];
[folder setOCSPath: [NSString stringWithFormat: @"%@/%@", OCSPath, key]];
[folder setOCSPath: [NSString stringWithFormat: @"%@/%@", OCSPath, key]];
if (folder)
[subFolders setObject: folder forKey: key];
}
}
+2 -1
View File
@@ -33,7 +33,8 @@
- (BOOL) isICal;
- (BOOL) isICal4;
- (BOOL) isMacOSXAddressBookApp;
- (BOOL) isIPhoneAddressBookApp;
- (BOOL)isMacOSXCalendarApp;
- (BOOL)isIPhoneAddressBookApp;
- (BOOL) isAndroid;
@end
+16
View File
@@ -242,5 +242,21 @@
return ([[cc userAgent] rangeOfString: @"Android"].location != NSNotFound);
}
- (BOOL) isMacOSXVenturaCalendarApp
{
WEClientCapabilities *cc;
BOOL b;
cc = [self clientCapabilities];
b = (
(
[[cc userAgent] rangeOfString: @"macOS/13"].location != NSNotFound
&& [[cc userAgent] rangeOfString: @"dataaccessd"].location != NSNotFound
)
);
return b;
}
@end