diff options
author | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2021-10-27 13:56:09 +0300 |
---|---|---|
committer | Matthieu Gallien (Rebase PR Action) <matthieu_gallien@yahoo.fr> | 2021-11-02 11:15:54 +0300 |
commit | a62905f17a7b5d968d69f2887c173902961772d4 (patch) | |
tree | 3dc00e53f037b08f38f2651c2ebeba9ce709bc8d /src | |
parent | 3a98abb6ba82c2288fc93bb5c810fbe5f9ca03d2 (diff) |
properly extract the file id when querying server
use the proper local file id to get the e2ee meta data
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libsync/discoveryphase.cpp | 6 | ||||
-rw-r--r-- | src/libsync/discoveryphase.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 208b6e2ff..5206f7e90 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -351,6 +351,7 @@ void DiscoverySingleDirectoryJob::start() << "getetag" << "http://owncloud.org/ns:size" << "http://owncloud.org/ns:id" + << "http://owncloud.org/ns:fileid" << "http://owncloud.org/ns:downloadURL" << "http://owncloud.org/ns:dDC" << "http://owncloud.org/ns:permissions" @@ -453,6 +454,9 @@ void DiscoverySingleDirectoryJob::directoryListingIteratedSlot(const QString &fi _dataFingerprint = "[empty]"; } } + if (map.contains(QStringLiteral("fileid"))) { + _localFileId = map.value(QStringLiteral("fileid")).toUtf8(); + } if (map.contains("id")) { _fileId = map.value("id").toUtf8(); } @@ -529,7 +533,7 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r) void DiscoverySingleDirectoryJob::fetchE2eMetadata() { - auto job = new GetMetadataApiJob(_account, _fileId); + const auto job = new GetMetadataApiJob(_account, _localFileId); connect(job, &GetMetadataApiJob::jsonReceived, this, &DiscoverySingleDirectoryJob::metadataReceived); connect(job, &GetMetadataApiJob::error, diff --git a/src/libsync/discoveryphase.h b/src/libsync/discoveryphase.h index ac599a797..a02807341 100644 --- a/src/libsync/discoveryphase.h +++ b/src/libsync/discoveryphase.h @@ -144,6 +144,7 @@ private: QString _subPath; QByteArray _firstEtag; QByteArray _fileId; + QByteArray _localFileId; AccountPtr _account; // The first result is for the directory itself and need to be ignored. // This flag is true if it was already ignored. |