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

Expose if e2e keys is exists #1000

Merged
merged 2 commits into from
Nov 21, 2022
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 @@ -159,6 +159,9 @@ public class GetCapabilitiesRemoteOperation extends RemoteOperation {
private static final String NODE_USER_STATUS_ENABLED = "enabled";
private static final String NODE_USER_STATUS_SUPPORTS_EMOJI = "supports_emoji";

// end to end encryption
private static final String PROPERTY_KEYS_EXIST = "keys-exist";


private OCCapability currentCapability = null;

Expand Down Expand Up @@ -556,6 +559,19 @@ private OCCapability parseResponse(String response) throws JSONException {
} else {
capability.setEndToEndEncryption(CapabilityBooleanType.FALSE);
}

if (respEndToEndEncryption.has(PROPERTY_KEYS_EXIST)) {
final boolean keysExist = respEndToEndEncryption.getBoolean(PROPERTY_KEYS_EXIST);
if (keysExist) {
capability.setEndToEndEncryptionKeysExist(CapabilityBooleanType.TRUE);
} else {
capability.setEndToEndEncryptionKeysExist(CapabilityBooleanType.FALSE);
}
} else {
capability.setEndToEndEncryptionKeysExist(CapabilityBooleanType.UNKNOWN);
}


Log_OC.d(TAG, "*** Added " + NODE_END_TO_END_ENCRYPTION);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class OCCapability {
var fullNextSearchFiles: CapabilityBooleanType? = null

var endToEndEncryption = CapabilityBooleanType.UNKNOWN
var endToEndEncryptionKeysExist = CapabilityBooleanType.UNKNOWN

// Richdocuments
var richDocuments = CapabilityBooleanType.UNKNOWN
Expand Down