aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorAlexander Tkachev2016-07-19 15:47:46 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitd0c54cdd64a174f648321608d29f3c0860837256 (patch)
treef63c69502d61c2e557b5d2f8b9fe5de7be48761a /backends
parent55568d757ce2990a285a6193a60242f9932d0797 (diff)
downloadscummvm-rg350-d0c54cdd64a174f648321608d29f3c0860837256.tar.gz
scummvm-rg350-d0c54cdd64a174f648321608d29f3c0860837256.tar.bz2
scummvm-rg350-d0c54cdd64a174f648321608d29f3c0860837256.zip
CLOUD: Fix DropboxCreateDirectoryRequest
It now calls success callback with `false` on Dropbox's "path/conflict/folder", indicating that the directory already exists.
Diffstat (limited to 'backends')
-rw-r--r--backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
index a52d41e896..81ace75dda 100644
--- a/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
+++ b/backends/cloud/dropbox/dropboxcreatedirectoryrequest.cpp
@@ -84,6 +84,14 @@ void DropboxCreateDirectoryRequest::responseCallback(Networking::JsonResponse re
Common::JSONObject info = json->asObject();
if (info.contains("id")) finishCreation(true);
else {
+ if (info.contains("error_summary") && info.getVal("error_summary")->isString()) {
+ Common::String summary = info.getVal("error_summary")->asString();
+ if (summary.contains("path") && summary.contains("conflict") && summary.contains("folder")) {
+ finishCreation(false);
+ delete json;
+ return;
+ }
+ }
error.response = json->stringify(true);
finishError(error);
}