Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce drop-account capability #1213

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class OCCapability {
// Groupfolders
var groupfolders = CapabilityBooleanType.UNKNOWN

// Drop-Account
var dropAccount = CapabilityBooleanType.UNKNOWN

// Etag for capabilities
var etag: String? = ""

Expand Down
Loading