Skip to content

Commit

Permalink
fix(addressbook(dav)): add support for macOS 11 (Big Sur)
Browse files Browse the repository at this point in the history
Fixes #5203
  • Loading branch information
cgx committed Dec 1, 2020
1 parent 1268e23 commit c65e121
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions SoObjects/SOGo/WORequest+SOGo.m
Expand Up @@ -129,13 +129,16 @@ - (BOOL) isIPhone

//
// Mac+OS+X/10.10.1 (14B25) CalendarAgent/315
// macOS/11.0.1 (20B50) CalendarAgent/954
//
- (BOOL) isICal
{
return ([self isAppleDAVWithSubstring: @"Mac OS X/10."]
|| [self isAppleDAVWithSubstring: @"Mac_OS_X/"]
|| [self isAppleDAVWithSubstring: @"Mac+OS+X/"]
|| [self isAppleDAVWithSubstring: @"CoreDAV/"]);
|| [self isAppleDAVWithSubstring: @"macOS/"]
|| [self isAppleDAVWithSubstring: @"CoreDAV/"]
|| [[cc userAgent] rangeOfString: @"DAVx5"].location != NSNotFound);
}

//
Expand All @@ -144,6 +147,7 @@ - (BOOL) isICal
// Mac OS X/10.8 (12A269) Calendar/1639
// Mac OS X/10.8 (12A269) CalendarAgent/47
// Mac OS X/10.8.1 (12B19) CalendarAgent/47
// macOS/11.0.1 (20B50) CalendarAgent/954
//
- (BOOL) isICal4
{
Expand Down Expand Up @@ -172,6 +176,14 @@ - (BOOL) isICal4
// Mac OS X/10.8.1 (12B19) AddressBook/1143
// Mac OS X/10.8.2 (12C60) AddressBook/1167
//
// For 10.14, we see:
//
// Mac OS X/10.14.6 (18G6042) AddressBookCore/1
//
// For 11.0, we see:
//
// macOS/11.0.1 (20B50) AddressBookCore/2452
//
- (BOOL) isMacOSXAddressBookApp
{
WEClientCapabilities *cc;
Expand All @@ -194,7 +206,12 @@ - (BOOL) isMacOSXAddressBookApp
[[cc userAgent] rangeOfString: @"Mac OS X"].location != NSNotFound
&& [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound
)
);
||
(
[[cc userAgent] rangeOfString: @"macOS"].location != NSNotFound
&& [[cc userAgent] rangeOfString: @"AddressBookCore"].location != NSNotFound
)
);

return b;
}
Expand All @@ -206,7 +223,7 @@ - (BOOL) isIPhoneAddressBookApp
cc = [self clientCapabilities];

return ([[cc userAgent] rangeOfString: @"DataAccess/1.0"].location != NSNotFound ||
[[cc userAgent] rangeOfString: @"dataaccessd/1.0"].location != NSNotFound); // Seen on iOS 5.0.1 on iPad
[[cc userAgent] rangeOfString: @"dataaccessd/1.0"].location != NSNotFound); // Since iOS 5.0.1
}

- (BOOL) isAndroid
Expand Down

0 comments on commit c65e121

Please sign in to comment.