diff --git a/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesIT.java b/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesIT.java index 7e47325dc..742233f81 100644 --- a/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesIT.java +++ b/library/src/androidTest/java/com/owncloud/android/GetCapabilitiesIT.java @@ -130,6 +130,7 @@ private void checkCapability(OCCapability capability, String userId) { assertFalse(capability.getEtag().isEmpty()); assertSame(CapabilityBooleanType.FALSE, capability.getRichDocuments()); assertFalse(capability.getDirectEditingEtag().isEmpty()); + assertSame(CapabilityBooleanType.UNKNOWN, capability.getDropAccount()); // user status if (capability.getVersion().isNewerOrEqual(OwnCloudVersion.nextcloud_20)) { diff --git a/library/src/main/java/com/owncloud/android/lib/resources/status/GetCapabilitiesRemoteOperation.java b/library/src/main/java/com/owncloud/android/lib/resources/status/GetCapabilitiesRemoteOperation.java index 4717ac639..25e87e6e8 100644 --- a/library/src/main/java/com/owncloud/android/lib/resources/status/GetCapabilitiesRemoteOperation.java +++ b/library/src/main/java/com/owncloud/android/lib/resources/status/GetCapabilitiesRemoteOperation.java @@ -166,6 +166,9 @@ public class GetCapabilitiesRemoteOperation extends RemoteOperation { // end to end encryption private static final String PROPERTY_KEYS_EXIST = "keys-exist"; + // drop-account + private static final String NODE_DROP_ACCOUNT = "drop-account"; + private OCCapability currentCapability = null; @@ -673,6 +676,17 @@ private OCCapability parseResponse(String response) throws JSONException { } else { capability.setGroupfolders(CapabilityBooleanType.FALSE); } + + // drop-account + if (respCapabilities.has(NODE_DROP_ACCOUNT)) { + JSONObject dropAccountCapability = respCapabilities.getJSONObject(NODE_DROP_ACCOUNT); + + if (dropAccountCapability.getBoolean(PROPERTY_ENABLED)) { + capability.setDropAccount(CapabilityBooleanType.TRUE); + } else { + capability.setDropAccount(CapabilityBooleanType.FALSE); + } + } } Log_OC.d(TAG, "*** Get Capabilities completed "); diff --git a/library/src/main/java/com/owncloud/android/lib/resources/status/OCCapability.kt b/library/src/main/java/com/owncloud/android/lib/resources/status/OCCapability.kt index 11a050165..3a5a817ce 100644 --- a/library/src/main/java/com/owncloud/android/lib/resources/status/OCCapability.kt +++ b/library/src/main/java/com/owncloud/android/lib/resources/status/OCCapability.kt @@ -110,6 +110,9 @@ class OCCapability { // Groupfolders var groupfolders = CapabilityBooleanType.UNKNOWN + // Drop-Account + var dropAccount = CapabilityBooleanType.UNKNOWN + // Etag for capabilities var etag: String? = ""