aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/cloud/box/boxuploadrequest.cpp2
-rw-r--r--backends/cloud/googledrive/googledrivetokenrefresher.cpp2
-rw-r--r--backends/cloud/onedrive/onedrivetokenrefresher.cpp2
-rw-r--r--backends/cloud/savessyncrequest.cpp4
-rw-r--r--backends/networking/curl/curljsonrequest.cpp24
5 files changed, 17 insertions, 17 deletions
diff --git a/backends/cloud/box/boxuploadrequest.cpp b/backends/cloud/box/boxuploadrequest.cpp
index 929c9ceb75..5084aa5652 100644
--- a/backends/cloud/box/boxuploadrequest.cpp
+++ b/backends/cloud/box/boxuploadrequest.cpp
@@ -165,7 +165,7 @@ void BoxUploadRequest::uploadedCallback(Networking::JsonResponse response) {
Common::JSONArray entries = object.getVal("entries")->asArray();
if (entries.size() == 0) {
warning("BoxUploadRequest: 'entries' found, but it's empty");
- } else if (Networking::CurlJsonRequest::jsonIsObject(entries[0], "BoxUploadRequest")) {
+ } else if (!Networking::CurlJsonRequest::jsonIsObject(entries[0], "BoxUploadRequest")) {
warning("BoxUploadRequest: 'entries' first item is not an object");
} else {
Common::JSONObject item = entries[0]->asObject();
diff --git a/backends/cloud/googledrive/googledrivetokenrefresher.cpp b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
index 7d68510655..8cc492d6b4 100644
--- a/backends/cloud/googledrive/googledrivetokenrefresher.cpp
+++ b/backends/cloud/googledrive/googledrivetokenrefresher.cpp
@@ -66,7 +66,7 @@ void GoogleDriveTokenRefresher::finishJson(Common::JSONValue *json) {
if (jsonIsObject(json, "GoogleDriveTokenRefresher")) {
Common::JSONObject result = json->asObject();
long httpResponseCode = -1;
- if (jsonContainsAttribute(result, "error", "GoogleDriveTokenRefresher") && jsonIsObject(result.getVal("error"), "GoogleDriveTokenRefresher")) {
+ if (result.contains("error") && jsonIsObject(result.getVal("error"), "GoogleDriveTokenRefresher")) {
//new token needed => request token & then retry original request
if (_stream) {
httpResponseCode = _stream->httpResponseCode();
diff --git a/backends/cloud/onedrive/onedrivetokenrefresher.cpp b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
index 5ee2772ba7..ce7895f41c 100644
--- a/backends/cloud/onedrive/onedrivetokenrefresher.cpp
+++ b/backends/cloud/onedrive/onedrivetokenrefresher.cpp
@@ -66,7 +66,7 @@ void OneDriveTokenRefresher::finishJson(Common::JSONValue *json) {
if (jsonIsObject(json, "OneDriveTokenRefresher")) {
Common::JSONObject result = json->asObject();
long httpResponseCode = -1;
- if (jsonContainsAttribute(result, "error", "OneDriveTokenRefresher") && jsonIsObject(result.getVal("error"), "OneDriveTokenRefresher")) {
+ if (result.contains("error") && jsonIsObject(result.getVal("error"), "OneDriveTokenRefresher")) {
//new token needed => request token & then retry original request
if (_stream) {
httpResponseCode = _stream->httpResponseCode();
diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp
index 9c487bb987..fff46c3a83 100644
--- a/backends/cloud/savessyncrequest.cpp
+++ b/backends/cloud/savessyncrequest.cpp
@@ -153,7 +153,7 @@ void SavesSyncRequest::directoryListedErrorCallback(Networking::ErrorResponse er
Common::JSONObject object = value->asObject();
//Dropbox-related error:
- if (Networking::CurlJsonRequest::jsonContainsString(object, "error_summary", "SavesSyncRequest", true)) {
+ if (object.contains("error_summary") && object.getVal("error_summary")->isString()) {
Common::String summary = object.getVal("error_summary")->asString();
if (summary.contains("not_found")) {
irrecoverable = false;
@@ -161,7 +161,7 @@ void SavesSyncRequest::directoryListedErrorCallback(Networking::ErrorResponse er
}
//OneDrive-related error:
- if (Networking::CurlJsonRequest::jsonContainsObject(object, "error", "SavesSyncRequest", true)) {
+ if (object.contains("error") && object.getVal("error")->isObject()) {
Common::JSONObject errorNode = object.getVal("error")->asObject();
if (Networking::CurlJsonRequest::jsonContainsString(errorNode, "code", "SavesSyncRequest")) {
Common::String code = errorNode.getVal("code")->asString();
diff --git a/backends/networking/curl/curljsonrequest.cpp b/backends/networking/curl/curljsonrequest.cpp
index 6ff35d7b3d..1899cbd913 100644
--- a/backends/networking/curl/curljsonrequest.cpp
+++ b/backends/networking/curl/curljsonrequest.cpp
@@ -109,7 +109,7 @@ bool CurlJsonRequest::jsonIsObject(Common::JSONValue *item, const char *warningP
if (item->isObject()) return true;
- warning("%s: passed item is not an object!", warningPrefix);
+ warning("%s: passed item is not an object", warningPrefix);
debug(9, "%s", item->stringify(true).c_str());
return false;
}
@@ -120,13 +120,13 @@ bool CurlJsonRequest::jsonContainsObject(Common::JSONObject &item, const char *k
return true;
}
- warning("%s: passed item misses the \"%s\" attribute!", warningPrefix, key);
+ warning("%s: passed item misses the \"%s\" attribute", warningPrefix, key);
return false;
}
if (item.getVal(key)->isObject()) return true;
- warning("%s: passed item's \"%s\" attribute is not an object!", warningPrefix, key);
+ warning("%s: passed item's \"%s\" attribute is not an object", warningPrefix, key);
debug(9, "%s", item.getVal(key)->stringify(true).c_str());
return false;
}
@@ -137,13 +137,13 @@ bool CurlJsonRequest::jsonContainsString(Common::JSONObject &item, const char *k
return true;
}
- warning("%s: passed item misses the \"%s\" attribute!", warningPrefix, key);
+ warning("%s: passed item misses the \"%s\" attribute", warningPrefix, key);
return false;
}
if (item.getVal(key)->isString()) return true;
- warning("%s: passed item's \"%s\" attribute is not a string!", warningPrefix, key);
+ warning("%s: passed item's \"%s\" attribute is not a string", warningPrefix, key);
debug(9, "%s", item.getVal(key)->stringify(true).c_str());
return false;
}
@@ -154,13 +154,13 @@ bool CurlJsonRequest::jsonContainsIntegerNumber(Common::JSONObject &item, const
return true;
}
- warning("%s: passed item misses the \"%s\" attribute!", warningPrefix, key);
+ warning("%s: passed item misses the \"%s\" attribute", warningPrefix, key);
return false;
}
if (item.getVal(key)->isIntegerNumber()) return true;
- warning("%s: passed item's \"%s\" attribute is not an integer!", warningPrefix, key);
+ warning("%s: passed item's \"%s\" attribute is not an integer", warningPrefix, key);
debug(9, "%s", item.getVal(key)->stringify(true).c_str());
return false;
}
@@ -171,13 +171,13 @@ bool CurlJsonRequest::jsonContainsArray(Common::JSONObject &item, const char *ke
return true;
}
- warning("%s: passed item misses the \"%s\" attribute!", warningPrefix, key);
+ warning("%s: passed item misses the \"%s\" attribute", warningPrefix, key);
return false;
}
if (item.getVal(key)->isArray()) return true;
- warning("%s: passed item's \"%s\" attribute is not an array!", warningPrefix, key);
+ warning("%s: passed item's \"%s\" attribute is not an array", warningPrefix, key);
debug(9, "%s", item.getVal(key)->stringify(true).c_str());
return false;
}
@@ -188,13 +188,13 @@ bool CurlJsonRequest::jsonContainsStringOrIntegerNumber(Common::JSONObject &item
return true;
}
- warning("%s: passed item misses the \"%s\" attribute!", warningPrefix, key);
+ warning("%s: passed item misses the \"%s\" attribute", warningPrefix, key);
return false;
}
if (item.getVal(key)->isString() || item.getVal(key)->isIntegerNumber()) return true;
- warning("%s: passed item's \"%s\" attribute is neither a string or an integer!", warningPrefix, key);
+ warning("%s: passed item's \"%s\" attribute is neither a string or an integer", warningPrefix, key);
debug(9, "%s", item.getVal(key)->stringify(true).c_str());
return false;
}
@@ -205,7 +205,7 @@ bool CurlJsonRequest::jsonContainsAttribute(Common::JSONObject &item, const char
return true;
}
- warning("%s: passed item misses the \"%s\" attribute!", warningPrefix, key);
+ warning("%s: passed item misses the \"%s\" attribute", warningPrefix, key);
return false;
}