From 79c0c2362b262f558eaef9611eb0e53a1c743d8a Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 21 Nov 2011 14:15:14 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 82564e2898976a6c09a85817e4b2954a5c58b7a9 Monotone-Revision: 387161e51d5f56bffe765c8e46dec729db13794d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-11-21T14:15:14 --- ChangeLog | 10 ++++++++++ SoObjects/Contacts/SOGoContactGCSFolder.m | 2 +- SoObjects/SOGo/WORequest+SOGo.m | 21 ++++++++++++++++++--- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f0ab2025..6557b460a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-11-21 Ludovic Marcotte + + * SoObjects/SOGo/WORequest+SOGo.m - for now, we consider iCal 4 + and iCal 5 to be the same and added new strings to recognize + Apple Address Book on Mac OS X 10.7 (Lion) + + * SoObjects/Contacts/SOGoContactGCSFolder.m - we now skip list + if we deal with Apple Address Book. If we don't do this and + a "vlist" is present, no card will be displayed at all. + 2011-11-16 Ludovic Marcotte * SoObjects/SOGo/SOGoSieveManager.m (-updateFiltersForLogin:...) diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index e7128ed01..e395bf6f8 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -157,7 +157,7 @@ static NSArray *folderListingFields = nil; [obj setIsNew: YES]; } } - if (!obj) + if (!obj || ([obj isKindOfClass: [SOGoContactGCSList class]] && [[_ctx request] isMacOSXAddressBookApp])) obj = [NSException exceptionWithHTTPStatus:404 /* Not Found */]; } diff --git a/SoObjects/SOGo/WORequest+SOGo.m b/SoObjects/SOGo/WORequest+SOGo.m index 7a7703b13..31671a019 100644 --- a/SoObjects/SOGo/WORequest+SOGo.m +++ b/SoObjects/SOGo/WORequest+SOGo.m @@ -134,19 +134,34 @@ return [self isAppleDAVWithSubstring: @"Mac OS X/10."]; } +// +// sogod[22188] -[WEClientCapabilities initWithRequest:]: Unknown WebClient: user-agent='CalendarStore/5.0.1 (1139.14); iCal/5.0.1 (1547.4); Mac OS X/10.7.2 (11C74)' +// +// - (BOOL) isICal4 { - return [self isAppleDAVWithSubstring: @"iCal/4."]; + return ([self isAppleDAVWithSubstring: @"iCal/4."] || + [self isAppleDAVWithSubstring: @"iCal/5."]); } + +// +// Starting from 10.7, we see something like: +// +// sogod[27330] -[WEClientCapabilities initWithRequest:]: Unknown WebClient: user-agent='AddressBook/6.1 (1062) CardDAVPlugin/196 CFNetwork/520.2.5 Mac_OS_X/10.7.2 (11C74)' +// - (BOOL) isMacOSXAddressBookApp { WEClientCapabilities *cc; + BOOL b; cc = [self clientCapabilities]; - return ([[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound - && [[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound); + b = [[cc userAgent] rangeOfString: @"CFNetwork"].location != NSNotFound && + ([[cc userAgent] rangeOfString: @"Darwin"].location != NSNotFound || + [[cc userAgent] rangeOfString: @"AddressBook"].location != NSNotFound); + + return b; } - (BOOL) isIPhoneAddressBookApp