Don't show Encrypt menu entry if server does not support E2EE

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2022-12-12 12:12:46 +01:00 committed by Claudio Cambra
parent 01334e40f9
commit a23db4688a

View file

@ -1166,7 +1166,12 @@ void SocketApi::sendEncryptFolderCommandMenuEntries(const QFileInfo &fileInfo,
const bool isE2eEncryptedPath,
const OCC::SocketListener* const listener) const
{
if (!fileInfo.isDir() || isE2eEncryptedPath) {
if (!fileData.folder ||
!fileData.folder->accountState() ||
!fileData.folder->accountState()->account() ||
!fileData.folder->accountState()->account()->capabilities().clientSideEncryptionAvailable() ||
!fileInfo.isDir() ||
isE2eEncryptedPath) {
return;
}