Fix CardDAV collections for OS X

Restored the previous behavior: only the personal addressbook is
returned and only the first source directory is returned (now sorted by
id so you can control which of your addressbook sources you want to
return).
This commit is contained in:
Francis Lachapelle
2013-01-09 11:39:29 -05:00
parent cd0244883d
commit 5667bb1b11
3 changed files with 21 additions and 7 deletions
+4 -2
View File
@@ -61,7 +61,7 @@
- (NSArray *) davDirectoryGateway
{
NSArray *tag, *sources;
NSArray *tag, *sources, *sorted_sources;
SOGoContactFolders *parent;
SOGoUserManager *um;
NSString *domain, *url;
@@ -71,9 +71,11 @@
sources = [um addressBookSourceIDsInDomain: domain];
if ([sources count] > 0)
{
// Only return the first ID from the sorted list of sources
parent = [self privateContacts: @"Contacts" inContext: context];
sorted_sources = [sources sortedArrayUsingSelector: @selector (localizedCaseInsensitiveCompare:)];
url = [NSString stringWithFormat: @"%@%@/", [parent davURLAsString],
[sources objectAtIndex: 0]];
[sorted_sources objectAtIndex: 0]];
tag = [NSArray arrayWithObject:
[NSArray arrayWithObjects: @"href", @"DAV:", @"D",
url, nil]];