From 0a2244c2cb6fdd2c47cd41218ed746f118a920d8 Mon Sep 17 00:00:00 2001 From: Jean Raby Date: Fri, 29 Jun 2012 20:17:20 +0000 Subject: [PATCH] * SoObjects/SOGo/WORequest+SOGo.[mh] (-isAndroid): new method to detect whether the request has been performed from an android client * SoObjects/Contacts/SOGoContactFolders.m (appendSystemSources): Let sogo append system sources if the request comes from an android client even if its user agent matches the IPhoneAddressBook Monotone-Parent: a4ef73c2ad79c8da8d8e0c93767ab06e14bc846b Monotone-Revision: 228f7d730cde5a5046b0885c1ac02649ee2b7c05 Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-06-29T20:17:20 --- ChangeLog | 10 ++++++++++ SoObjects/Contacts/SOGoContactFolders.m | 6 ++++-- SoObjects/SOGo/WORequest+SOGo.h | 1 + SoObjects/SOGo/WORequest+SOGo.m | 11 +++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d87b63f59..334c14772 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-06-29 Jean Raby + + * SoObjects/SOGo/WORequest+SOGo.[mh] + (-isAndroid): new method to detect whether the + request has been performed from an android client + + * SoObjects/Contacts/SOGoContactFolders.m (appendSystemSources): + Let sogo append system sources if the request comes from an android + client even if its user agent matches the IPhoneAddressBook + 2012-06-27 Jean Raby * SoObjects/Appointments/SOGoAppointmentObject.m diff --git a/SoObjects/Contacts/SOGoContactFolders.m b/SoObjects/Contacts/SOGoContactFolders.m index 537d7a08a..57aa27ab4 100644 --- a/SoObjects/Contacts/SOGoContactFolders.m +++ b/SoObjects/Contacts/SOGoContactFolders.m @@ -127,7 +127,8 @@ SOGoContactSourceFolder *currentFolder; SOGoUser *currentUser; - if (![[context request] isIPhoneAddressBookApp]) + if (! ([[context request] isIPhoneAddressBookApp] && + ![[context request] isAndroid])) { currentUser = [context activeUser]; if (activeUserIsOwner @@ -271,7 +272,8 @@ NSArray *sourceIDs; NSString *domain, *srcDisplayName; - if ([[context request] isIPhoneAddressBookApp]) + if ([[context request] isIPhoneAddressBookApp] && + ![[context request] isAndroid]) { currentUser = [context activeUser]; if (activeUserIsOwner diff --git a/SoObjects/SOGo/WORequest+SOGo.h b/SoObjects/SOGo/WORequest+SOGo.h index 3983c5a80..f749d183c 100644 --- a/SoObjects/SOGo/WORequest+SOGo.h +++ b/SoObjects/SOGo/WORequest+SOGo.h @@ -36,6 +36,7 @@ - (BOOL) isICal4; - (BOOL) isMacOSXAddressBookApp; - (BOOL) isIPhoneAddressBookApp; +- (BOOL) isAndroid; @end diff --git a/SoObjects/SOGo/WORequest+SOGo.m b/SoObjects/SOGo/WORequest+SOGo.m index c7b76fbbb..b972f22e2 100644 --- a/SoObjects/SOGo/WORequest+SOGo.m +++ b/SoObjects/SOGo/WORequest+SOGo.m @@ -176,4 +176,15 @@ [[cc userAgent] rangeOfString: @"dataaccessd/1.0"].location != NSNotFound); // Seen on iOS 5.0.1 on iPad } +- (BOOL) isAndroid +{ + WEClientCapabilities *cc; + + cc = [self clientCapabilities]; + + // CardDAV-Sync (Android) (like iOS/5.0.1 (9A405) dataaccessd/1.0) gzip + return ([[cc userAgent] rangeOfString: @"Android"].location != NSNotFound); +} + + @end