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 a3277eb commit b9e19c2
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions SoObjects/SOGo/WORequest+SOGo.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ - (BOOL) isIPhone

//
// Mac+OS+X/10.10.1 (14B25) CalendarAgent/315
// macOS/11.0.1 (20B50) CalendarAgent/954
//
- (BOOL) isICal
{
Expand All @@ -137,6 +138,7 @@ - (BOOL) isICal
return ([self isAppleDAVWithSubstring: @"Mac OS X/10."]
|| [self isAppleDAVWithSubstring: @"Mac_OS_X/"]
|| [self isAppleDAVWithSubstring: @"Mac+OS+X/"]
|| [self isAppleDAVWithSubstring: @"macOS/"]
|| [self isAppleDAVWithSubstring: @"CoreDAV/"]
|| [[cc userAgent] rangeOfString: @"DAVx5"].location != NSNotFound);
}
Expand All @@ -147,6 +149,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 @@ -175,6 +178,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 @@ -197,7 +208,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 @@ -209,7 +225,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 b9e19c2

Please sign in to comment.