diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index ab2bca7eb..7da5f1859 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -984,7 +984,7 @@ void ClientSideEncryption::getPublicKeyFromServer() void ClientSideEncryption::fetchFolderEncryptedStatus() { _refreshingEncryptionStatus = true; - auto getEncryptedStatus = new GetFolderEncryptStatus(_account); + auto getEncryptedStatus = new GetFolderEncryptStatus(_account, QString()); connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusReceived, this, &ClientSideEncryption::folderEncryptedStatusFetched); connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusError, @@ -1483,8 +1483,8 @@ bool GetMetadataApiJob::finished() return true; } -GetFolderEncryptStatus::GetFolderEncryptStatus(const AccountPtr& account, QObject *parent) - : OCC::AbstractNetworkJob(account, QStringLiteral("remote.php/webdav"), parent) +GetFolderEncryptStatus::GetFolderEncryptStatus(const AccountPtr& account, const QString& folder, QObject *parent) + : OCC::AbstractNetworkJob(account, QStringLiteral("remote.php/webdav"), parent), _folder(folder) { } @@ -1499,7 +1499,8 @@ void GetFolderEncryptStatus::start() QBuffer *buf = new QBuffer(this); buf->setData(xml); buf->open(QIODevice::ReadOnly); - sendRequest("PROPFIND", Utility::concatUrlPath(account()->url(), path()), req, buf); + QString tmpPath = path() + (!_folder.isEmpty() ? "/" + _folder : QString()); + sendRequest("PROPFIND", Utility::concatUrlPath(account()->url(), tmpPath), req, buf); AbstractNetworkJob::start(); } diff --git a/src/libsync/clientsideencryption.h b/src/libsync/clientsideencryption.h index 3873ba414..ffeed550f 100644 --- a/src/libsync/clientsideencryption.h +++ b/src/libsync/clientsideencryption.h @@ -341,7 +341,7 @@ class OWNCLOUDSYNC_EXPORT GetFolderEncryptStatus : public AbstractNetworkJob { Q_OBJECT public: - explicit GetFolderEncryptStatus (const AccountPtr &account, QObject *parent = 0); + explicit GetFolderEncryptStatus (const AccountPtr &account, const QString& folder, QObject *parent = 0); public slots: void start() override; @@ -352,6 +352,8 @@ protected: signals: void encryptStatusReceived(const QMap folderMetadata2EncryptionStatus); void encryptStatusError(int statusCode); +private: + QString _folder; }; } // namespace OCC diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp index 4f84fa839..0631db984 100644 --- a/src/libsync/propagateupload.cpp +++ b/src/libsync/propagateupload.cpp @@ -192,7 +192,11 @@ void PropagateUploadFileCommon::start() * * If the folder is unencrypted we just follow the old way. */ - auto getEncryptedStatus = new GetFolderEncryptStatus(propagator()->account()); + QFileInfo info(_item->_file); + + auto getEncryptedStatus = new GetFolderEncryptStatus(propagator()->account(), + info.path()); + connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusReceived, this, &PropagateUploadFileCommon::slotFolderEncryptedStatusFetched); connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusError,