From: Kevin Ottens Date: Tue, 1 Dec 2020 11:45:01 +0000 (+0100) Subject: Make sure the encrypted flag gets all the way to the journal db X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~47 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=567f678fd5d5abe0c653ede7c4526c43cfba544b;p=nextcloud-desktop.git Make sure the encrypted flag gets all the way to the journal db Signed-off-by: Kevin Ottens --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 75eaa4143..b4a42200f 100644 --- a/src/libsync/discovery.cpp +++ b/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 { diff --git a/src/libsync/propagateuploadencrypted.cpp b/src/libsync/propagateuploadencrypted.cpp index cf23fffe2..2bce8b5ad 100644 --- a/src/libsync/propagateuploadencrypted.cpp +++ b/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."; diff --git a/src/libsync/syncfileitem.cpp b/src/libsync/syncfileitem.cpp index c72cb1b46..de33eb70f 100644 --- a/src/libsync/syncfileitem.cpp +++ b/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; } diff --git a/src/libsync/syncfileitem.h b/src/libsync/syncfileitem.h index 29fda0d2f..e20794921 100644 --- a/src/libsync/syncfileitem.h +++ b/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