From: Olivier Goffart Date: Thu, 26 Jul 2018 08:16:28 +0000 (+0200) Subject: New discovery phase: read the direct download URL and Cookie X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~537 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1bcbcd407c8e48245fb1e837938bc9e8e8b01091;p=nextcloud-desktop.git New discovery phase: read the direct download URL and Cookie --- diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 0e7920335..8e2d183bb 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -411,6 +411,8 @@ void ProcessDirectoryJob::processFile(PathTuple path, item->_etag = serverEntry.etag; item->_previousSize = localEntry.size; item->_previousModtime = localEntry.modtime; + item->_directDownloadUrl = serverEntry.directDownloadUrl; + item->_directDownloadCookies = serverEntry.directDownloadCookies; if (!dbEntry.isValid() && !localEntry.isVirtualFile) { // New file on the server item->_instruction = CSYNC_INSTRUCTION_NEW; item->_direction = SyncFileItem::Down; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 047fc8ea7..e86423313 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -252,11 +252,9 @@ static void propertyMapToFileStat(const QMap &map, RemoteInfo } else if (property == "id") { result.fileId = value.toUtf8(); } else if (property == "downloadURL") { - qFatal("FIXME: downloadURL and dDC"); - //file_stat->directDownloadUrl = value.toUtf8(); + result.directDownloadUrl = value; } else if (property == "dDC") { - qFatal("FIXME: downloadURL and dDC"); - // file_stat->directDownloadCookies = value.toUtf8(); + result.directDownloadCookies = value; } else if (property == "permissions") { result.remotePerm = RemotePermissions(value); } else if (property == "checksums") { diff --git a/src/libsync/discoveryphase.h b/src/libsync/discoveryphase.h index 94ca1b640..82f69266c 100644 --- a/src/libsync/discoveryphase.h +++ b/src/libsync/discoveryphase.h @@ -52,6 +52,9 @@ struct RemoteInfo int64_t size = 0; bool isDirectory = false; bool isValid() const { return !name.isNull(); } + + QString directDownloadUrl; + QString directDownloadCookies; }; struct LocalInfo