Always use PROPFIND instead of REPORT addressbook-query

pull/2/head
Ricki Hirner 8 years ago
parent b757cba521
commit d688eb5196

@ -10,7 +10,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
buildToolsVersion '24.0.2'
defaultConfig {
applicationId "at.bitfire.davdroid"
@ -62,6 +62,7 @@ android {
}
dependencies {
compile project(':cert4android')
compile project(':dav4android')
compile project(':ical4android')
compile project(':vcard4android')
@ -72,13 +73,11 @@ dependencies {
compile 'com.android.support:preference-v14:24.+'
compile 'com.github.yukuku:ambilwarna:2.0.1'
compile project(':cert4android')
compile 'dnsjava:dnsjava:2.1.7'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.commons:commons-collections4:4.1'
provided 'org.projectlombok:lombok:1.16.10'
// for tests
testCompile 'junit:junit:4.12'
testCompile 'com.squareup.okhttp3:mockwebserver:3.4.1'

@ -47,6 +47,7 @@ import at.bitfire.dav4android.property.AddressData;
import at.bitfire.dav4android.property.GetCTag;
import at.bitfire.dav4android.property.GetContentType;
import at.bitfire.dav4android.property.GetETag;
import at.bitfire.dav4android.property.ResourceType;
import at.bitfire.dav4android.property.SupportedAddressData;
import at.bitfire.davdroid.AccountSettings;
import at.bitfire.davdroid.App;
@ -269,26 +270,15 @@ public class ContactsSyncManager extends SyncManager {
@Override
protected void listRemote() throws IOException, HttpException, DavException {
// fetch list of remote VCards and build hash table to index file name
try {
davAddressBook().addressbookQuery();
} catch(HttpException e) {
/* non-successful responses to CARDDAV:addressbook-query with empty filter, tested on 2015/10/21
* fastmail.com 403 Forbidden (DAV:error CARDDAV:supported-filter)
* mailbox.org (OpenXchange) 400 Bad Request
* SOGo 207 Multi-status, but without entries http://www.sogo.nu/bugs/view.php?id=3370
* Zimbra ZCS 500 Server Error https://bugzilla.zimbra.com/show_bug.cgi?id=101902
*/
if (e.status == 400 || e.status == 403 || e.status == 500 || e.status == 501) {
App.log.log(Level.WARNING, "Server error on REPORT addressbook-query, falling back to PROPFIND", e);
davAddressBook().propfind(1, GetETag.NAME);
} else
// no defined fallback, pass through exception
throw e;
}
davAddressBook().propfind(1, ResourceType.NAME, GetETag.NAME);
remoteResources = new HashMap<>(davCollection.members.size());
for (DavResource vCard : davCollection.members) {
// ignore member collections
ResourceType type = (ResourceType)vCard.properties.get(ResourceType.NAME);
if (type != null && type.types.contains(ResourceType.COLLECTION))
continue;
String fileName = vCard.fileName();
App.log.fine("Found remote VCard: " + fileName);
remoteResources.put(fileName, vCard);

@ -51,6 +51,7 @@
android:layout_marginBottom="32dp"/>
<TextView
android:id="@+id/license_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextView.Heading"

@ -1 +1 @@
Subproject commit a0570cb416ae586fbdc8c2f7383d89966b53d62e
Subproject commit d112d09cd9c7fb360decd85470b54415adbd0eee

@ -1 +1 @@
Subproject commit ff40bfd61f40a445b0e9414ae15b4a02fb95f64b
Subproject commit 0b0405a95dda7a0435e4b2562c90c0b7311e171f

@ -1 +1 @@
Subproject commit 2a0421f34909a7ac7989fdbd073c64891686f2fb
Subproject commit c075d3803ae0b0b0b008f96e541cded183d1dd2b

@ -1 +1 @@
Subproject commit e8a3a484900fc691b46acf768c212631ced46773
Subproject commit 499901fc285c1bb3356feb7446a85db268d57a1d
Loading…
Cancel
Save