Compare commits

...
Author SHA1 Message Date
tobiasKaminsky 66a8058194 Only allow creation of encrypted folder in root
Signed-off-by: tobiasKaminsky <[email protected]>
2024-10-09 18:59:16 +02:00
@@ -237,7 +237,7 @@ public class FileMenuFilter {
private void filterEncrypt(List<Integer> toHide, boolean endToEndEncryptionEnabled) {
if (files.isEmpty() || !isSingleSelection() || isSingleFile() || isEncryptedFolder() || isGroupFolder()
|| !endToEndEncryptionEnabled || !isEmptyFolder() || isShared()) {
|| !endToEndEncryptionEnabled || !isEmptyFolder() || isShared() || isInSubFolder()) {
toHide.add(R.id.action_encrypted);
}
}
@@ -581,4 +581,15 @@ public class FileMenuFilter {
}
return false;
}
private boolean isInSubFolder() {
OCFile folder = files.iterator().next();
OCFile parent = storageManager.getFileById(folder.getParentId());
if (parent == null) {
return false;
}
return !OCFile.ROOT_PATH.equals(parent.getRemotePath());
}
}