Merge pull request #3928 from nextcloud/bugfix/fixE2EEMetaData

properly extract the file id when querying server
This commit is contained in:
Matthieu Gallien 2021-11-02 09:46:38 +01:00 committed by GitHub
commit e4eaf9d88d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -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,

View file

@ -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.