mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Merge pull request #10388 from nextcloud/unsetEncryptedFolder
Only allow folder to unset if not in e2e subtree
This commit is contained in:
commit
d14ba71b10
1 changed files with 9 additions and 2 deletions
|
@ -319,7 +319,7 @@ public class FileMenuFilter {
|
|||
}
|
||||
|
||||
private void filterUnsetEncrypted(List<Integer> toShow, List<Integer> toHide, boolean endToEndEncryptionEnabled) {
|
||||
if (files.isEmpty() || !isSingleSelection() || isSingleFile() || !isEncryptedFolder()
|
||||
if (files.isEmpty() || !isSingleSelection() || isSingleFile() || !isEncryptedFolder() || hasEncryptedParent()
|
||||
|| !endToEndEncryptionEnabled) {
|
||||
toHide.add(R.id.action_unset_encrypted);
|
||||
} else {
|
||||
|
@ -550,6 +550,13 @@ public class FileMenuFilter {
|
|||
return files.iterator().next().isGroupFolder();
|
||||
}
|
||||
|
||||
private boolean hasEncryptedParent() {
|
||||
OCFile folder = files.iterator().next();
|
||||
OCFile parent = componentsGetter.getStorageManager().getFileById(folder.getParentId());
|
||||
|
||||
return parent != null && parent.isEncrypted();
|
||||
}
|
||||
|
||||
private boolean isSingleImage() {
|
||||
return isSingleSelection() && MimeTypeUtil.isImage(files.iterator().next());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue