only add encrypt menu entry for top folders
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Wed, 21 Aug 2024 13:50:04 +0000 (15:50 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Thu, 22 Aug 2024 08:12:32 +0000 (10:12 +0200)
with current end-to-end encryption only top folders can be encrypted

limit the availability of the menu entry to top folders

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/socketapi/socketapi.cpp

index a3c0186e3ad5fd176a14a449a725a759b86fe1a1..5b7206713e67435eb11505fd6f84c7b2931b3dbf 100644 (file)
@@ -1257,7 +1257,7 @@ void SocketApi::sendEncryptFolderCommandMenuEntries(const QFileInfo &fileInfo,
         ancestor = ancestor.parentFolder();
     }
 
-    if (!anyAncestorEncrypted) {
+    if (!anyAncestorEncrypted && !fileData.parentFolder().journalRecord().isValid()) {
         const auto isOnTheServer = fileData.journalRecord().isValid();
         const auto flagString = isOnTheServer ? QLatin1String("::") : QLatin1String(":d:");
         listener->sendMessage(QStringLiteral("MENU_ITEM:ENCRYPT") + flagString + tr("Encrypt"));