Przeglądaj źródła

Make sure the encrypted flag gets all the way to the journal db

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Kevin Ottens 5 lat temu
rodzic
commit
567f678fd5

+ 1 - 0
src/libsync/discovery.cpp

@@ -399,6 +399,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(
     item->_directDownloadUrl = serverEntry.directDownloadUrl;
     item->_directDownloadCookies = serverEntry.directDownloadCookies;
     item->_encryptedFileName = serverEntry.e2eMangledName;
+    item->_isEncrypted = serverEntry.isE2eEncrypted;
 
     // Check for missing server data
     {

+ 1 - 0
src/libsync/propagateuploadencrypted.cpp

@@ -184,6 +184,7 @@ void PropagateUploadEncrypted::slotFolderEncryptedMetadataReceived(const QJsonDo
   }
 
   _item->_encryptedFileName = _remoteParentPath + QLatin1Char('/') + encryptedFile.encryptedFilename;
+  _item->_isEncrypted = true;
 
   qCDebug(lcPropagateUploadEncrypted) << "Creating the encrypted file.";
 

+ 2 - 0
src/libsync/syncfileitem.cpp

@@ -44,6 +44,7 @@ SyncJournalFileRecord SyncFileItem::toSyncJournalFileRecordWithInode(const QStri
     rec._serverHasIgnoredFiles = _serverHasIgnoredFiles;
     rec._checksumHeader = _checksumHeader;
     rec._e2eMangledName = _encryptedFileName.toUtf8();
+    rec._isE2eEncrypted = _isEncrypted;
 
     // Update the inode if possible
     rec._inode = _inode;
@@ -73,6 +74,7 @@ SyncFileItemPtr SyncFileItem::fromSyncJournalFileRecord(const SyncJournalFileRec
     item->_serverHasIgnoredFiles = rec._serverHasIgnoredFiles;
     item->_checksumHeader = rec._checksumHeader;
     item->_encryptedFileName = QString::fromUtf8(rec._e2eMangledName);
+    item->_isEncrypted = rec._isE2eEncrypted;
     return item;
 }
 

+ 2 - 0
src/libsync/syncfileitem.h

@@ -107,6 +107,7 @@ public:
         , _status(NoStatus)
         , _isRestoration(false)
         , _isSelectiveSync(false)
+        , _isEncrypted(false)
     {
     }
 
@@ -241,6 +242,7 @@ public:
     Status _status BITFIELD(4);
     bool _isRestoration BITFIELD(1); // The original operation was forbidden, and this is a restoration
     bool _isSelectiveSync BITFIELD(1); // The file is removed or ignored because it is in the selective sync list
+    bool _isEncrypted BITFIELD(1); // The file is E2EE or the content of the directory should be E2EE
     quint16 _httpErrorCode = 0;
     RemotePermissions _remotePerm;
     QString _errorString; // Contains a string only in case of error