aboutsummaryrefslogtreecommitdiff
path: root/restapi/subscriptions.c
diff options
context:
space:
mode:
authorJulien Dessaux2019-09-12 18:01:14 +0200
committerJulien Dessaux2019-09-12 18:01:14 +0200
commit0bc24859aeca6a4e0d34f05b60b27250b1253ddd (patch)
tree4aeb8a1c304a80d4ed7c18491fde2e5d54b47451 /restapi/subscriptions.c
parentFixed code flow with memory free (diff)
downloadrocket-cli-client-0bc24859aeca6a4e0d34f05b60b27250b1253ddd.tar.gz
rocket-cli-client-0bc24859aeca6a4e0d34f05b60b27250b1253ddd.tar.bz2
rocket-cli-client-0bc24859aeca6a4e0d34f05b60b27250b1253ddd.zip
Changed subscription id to rid
Diffstat (limited to 'restapi/subscriptions.c')
-rw-r--r--restapi/subscriptions.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/restapi/subscriptions.c b/restapi/subscriptions.c
index e41cf95..5a1abe6 100644
--- a/restapi/subscriptions.c
+++ b/restapi/subscriptions.c
@@ -37,13 +37,13 @@ restapi_subscriptions_get(void)
}
const cJSON* update = NULL;
cJSON_ArrayForEach(update, updates) {
- const cJSON* id = cJSON_GetObjectItemCaseSensitive(update, "_id");
+ const cJSON* rid = cJSON_GetObjectItemCaseSensitive(update, "rid");
const cJSON* name = cJSON_GetObjectItemCaseSensitive(update, "name");
const cJSON* type = cJSON_GetObjectItemCaseSensitive(update, "t");
const cJSON* open = cJSON_GetObjectItemCaseSensitive(update, "open");
const cJSON* unread = cJSON_GetObjectItemCaseSensitive(update, "unread");
enum subscription_type etype;
- if (!cJSON_IsString(id) || id->valuestring == NULL || !cJSON_IsString(name) || name->valuestring == NULL || !cJSON_IsString(type) || type->valuestring == NULL || !cJSON_IsTrue(open) || !cJSON_IsNumber(unread))
+ if (!cJSON_IsString(rid) || rid->valuestring == NULL || !cJSON_IsString(name) || name->valuestring == NULL || !cJSON_IsString(type) || type->valuestring == NULL || !cJSON_IsTrue(open) || !cJSON_IsNumber(unread))
continue;
if (strcmp(type->valuestring, "c") == 0)
etype = SUBSCRIPTION_CHANNEL;
@@ -55,7 +55,7 @@ restapi_subscriptions_get(void)
fprintf(stderr, "Bug found : Unknown subscription type %s\n%s\n", type->valuestring, buffer);
exit(999);
}
- common_subscription_add(&subscriptions, id->valuestring, name->valuestring, etype, unread->valueint);
+ common_subscription_add(&subscriptions, rid->valuestring, name->valuestring, etype, unread->valueint);
}
}
get_json_cleanup: