CLOUD: Add Request::date()

Used in SavesSyncRequest to update Storage's last sync date.
This commit is contained in:
Alexander Tkachev 2016-06-10 15:01:56 +06:00
parent 6a93e8dd09
commit 3e6503743c
20 changed files with 92 additions and 0 deletions

View file

@ -71,6 +71,8 @@ void DropboxListDirectoryRequest::responseCallback(Networking::JsonResponse resp
_workingRequest = nullptr;
if (_ignoreCallback) return;
if (response.request) _date = response.request->date();
Networking::ErrorResponse error(this);
Networking::CurlJsonRequest *rq = (Networking::CurlJsonRequest *)response.request;
if (rq && rq->getNetworkReadStream())
@ -137,6 +139,7 @@ void DropboxListDirectoryRequest::responseCallback(Networking::JsonResponse resp
void DropboxListDirectoryRequest::errorCallback(Networking::ErrorResponse error) {
_workingRequest = nullptr;
if (_ignoreCallback) return;
if (error.request) _date = error.request->date();
finishError(error);
}
@ -144,6 +147,8 @@ void DropboxListDirectoryRequest::handle() {}
void DropboxListDirectoryRequest::restart() { start(); }
Common::String DropboxListDirectoryRequest::date() const { return _date; }
void DropboxListDirectoryRequest::finishSuccess(Common::Array<StorageFile> &files) {
Request::finishSuccess();
if (_listDirectoryCallback) (*_listDirectoryCallback)(Storage::ListDirectoryResponse(this, files));