aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/googledrive/googledrivecreatedirectoryrequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/cloud/googledrive/googledrivecreatedirectoryrequest.cpp')
-rw-r--r--backends/cloud/googledrive/googledrivecreatedirectoryrequest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/backends/cloud/googledrive/googledrivecreatedirectoryrequest.cpp b/backends/cloud/googledrive/googledrivecreatedirectoryrequest.cpp
index 54eff3d6ad..2b7a805bb9 100644
--- a/backends/cloud/googledrive/googledrivecreatedirectoryrequest.cpp
+++ b/backends/cloud/googledrive/googledrivecreatedirectoryrequest.cpp
@@ -63,12 +63,14 @@ void GoogleDriveCreateDirectoryRequest::start() {
void GoogleDriveCreateDirectoryRequest::createdBaseDirectoryCallback(Storage::BoolResponse response) {
_workingRequest = nullptr;
if (_ignoreCallback) return;
+ if (response.request) _date = response.request->date();
resolveId();
}
void GoogleDriveCreateDirectoryRequest::createdBaseDirectoryErrorCallback(Networking::ErrorResponse error) {
_workingRequest = nullptr;
if (_ignoreCallback) return;
+ if (error.request) _date = error.request->date();
finishError(error);
}
@@ -85,6 +87,7 @@ void GoogleDriveCreateDirectoryRequest::resolveId() {
void GoogleDriveCreateDirectoryRequest::idResolvedCallback(Storage::UploadResponse response) {
_workingRequest = nullptr;
if (_ignoreCallback) return;
+ if (response.request) _date = response.request->date();
//resolved => folder already exists
finishSuccess(false);
@@ -93,6 +96,7 @@ void GoogleDriveCreateDirectoryRequest::idResolvedCallback(Storage::UploadRespon
void GoogleDriveCreateDirectoryRequest::idResolveFailedCallback(Networking::ErrorResponse error) {
_workingRequest = nullptr;
if (_ignoreCallback) return;
+ if (error.request) _date = error.request->date();
//not resolved => folder not exists
if (error.response.contains("no such file found in its parent directory")) {
@@ -116,12 +120,14 @@ void GoogleDriveCreateDirectoryRequest::idResolveFailedCallback(Networking::Erro
void GoogleDriveCreateDirectoryRequest::createdDirectoryCallback(Storage::BoolResponse response) {
_workingRequest = nullptr;
if (_ignoreCallback) return;
+ if (response.request) _date = response.request->date();
finishSuccess(response.value);
}
void GoogleDriveCreateDirectoryRequest::createdDirectoryErrorCallback(Networking::ErrorResponse error) {
_workingRequest = nullptr;
if (_ignoreCallback) return;
+ if (error.request) _date = error.request->date();
finishError(error);
}
@@ -129,6 +135,8 @@ void GoogleDriveCreateDirectoryRequest::handle() {}
void GoogleDriveCreateDirectoryRequest::restart() { start(); }
+Common::String GoogleDriveCreateDirectoryRequest::date() const { return _date; }
+
void GoogleDriveCreateDirectoryRequest::finishSuccess(bool success) {
Request::finishSuccess();
if (_boolCallback) (*_boolCallback)(Storage::BoolResponse(this, success));