1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
diff --git a/src/newsblurapi.cpp b/src/newsblurapi.cpp
index 2d1acda..99ce791 100644
--- a/src/newsblurapi.cpp
+++ b/src/newsblurapi.cpp
@@ -165,7 +165,7 @@ void NewsBlurApi::add_custom_headers(curl_slist** /* custom_headers */)
bool request_successfull(json_object* payload)
{
json_object* result{};
- if (json_object_object_get_ex(payload, "result", &result) == FALSE) {
+ if (json_object_object_get_ex(payload, "result", &result) == 0) {
return false;
} else {
return !strcmp("ok", json_object_get_string(result));
@@ -241,7 +241,7 @@ rsspp::Feed NewsBlurApi::fetch_feed(const std::string& id)
json_object* stories{};
if (json_object_object_get_ex(
- query_result, "stories", &stories) == FALSE) {
+ query_result, "stories", &stories) == 0) {
LOG(Level::ERROR,
"NewsBlurApi::fetch_feed: request returned no "
"stories");
@@ -270,37 +270,37 @@ rsspp::Feed NewsBlurApi::fetch_feed(const std::string& id)
json_object* node{};
if (json_object_object_get_ex(
- item_obj, "story_title", &node) == TRUE) {
+ item_obj, "story_title", &node) == 1) {
item.title = json_object_get_string(node);
}
if (json_object_object_get_ex(
- item_obj, "story_authors", &node) == TRUE) {
+ item_obj, "story_authors", &node) == 1) {
item.author = json_object_get_string(node);
}
if (json_object_object_get_ex(item_obj,
"story_permalink",
- &node) == TRUE) {
+ &node) == 1) {
item.link = json_object_get_string(node);
}
if (json_object_object_get_ex(
- item_obj, "story_content", &node) == TRUE) {
+ item_obj, "story_content", &node) == 1) {
item.content_encoded =
json_object_get_string(node);
}
const char* article_id{};
if (json_object_object_get_ex(item_obj, "id", &node) ==
- TRUE) {
+ 1) {
article_id = json_object_get_string(node);
}
item.guid = id + ID_SEPARATOR +
(article_id ? article_id : "");
if (json_object_object_get_ex(
- item_obj, "read_status", &node) == TRUE) {
+ item_obj, "read_status", &node) == 1) {
if (!static_cast<bool>(
json_object_get_int(node))) {
item.labels.push_back(
@@ -311,7 +311,7 @@ rsspp::Feed NewsBlurApi::fetch_feed(const std::string& id)
}
if (json_object_object_get_ex(
- item_obj, "story_date", &node) == TRUE) {
+ item_obj, "story_date", &node) == 1) {
const char* pub_date =
json_object_get_string(node);
item.pubDate_ts = parse_date(pub_date);
|