diff options
author | sijanec <anton@sijanec.eu> | 2021-03-18 14:25:47 +0100 |
---|---|---|
committer | sijanec <anton@sijanec.eu> | 2021-03-18 14:25:47 +0100 |
commit | 583cf346017c05df6e06d552313608a1789943a0 (patch) | |
tree | 839ccd06b6f67432771b0c4702380936b1e4323d /src/api.c | |
parent | finished first PoC code (diff) | |
download | discord.c-583cf346017c05df6e06d552313608a1789943a0.tar discord.c-583cf346017c05df6e06d552313608a1789943a0.tar.gz discord.c-583cf346017c05df6e06d552313608a1789943a0.tar.bz2 discord.c-583cf346017c05df6e06d552313608a1789943a0.tar.lz discord.c-583cf346017c05df6e06d552313608a1789943a0.tar.xz discord.c-583cf346017c05df6e06d552313608a1789943a0.tar.zst discord.c-583cf346017c05df6e06d552313608a1789943a0.zip |
Diffstat (limited to 'src/api.c')
-rw-r--r-- | src/api.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -285,8 +285,10 @@ cJSON * dc_api (struct dc_client * c, char * body, int isfmt, char * endpoint, . } else { curl_easy_getinfo(c->curl, CURLINFO_RESPONSE_CODE, &response_code); } +#ifdef DC_NETREQ fprintf(netreq, "%s\n%s\n%s\n%s====================================\n", endpoint_formatted ? endpoint_formatted : endpoint, body ? body : "GET", h->ptr, s->ptr); fflush(netreq); +#endif char * cp = strstr(h->ptr, "\nx-ratelimit-reset-after: "); if (cp == NULL) goto norlheaders; @@ -480,17 +482,17 @@ int dc_fetch_channels (struct dc_guild * g) { goto rc; } cJSON * channel = NULL; - cJSON * perms = NULL; - cJSON * perm = NULL; + /* cJSON * perms = NULL; */ /* I'll rather not remove the channels with perms and let the user get banned for joining a channel without perms */ + /* cJSON * perm = NULL; */ /* we lock all client guilds when doing stuff with channels */ if (DC_CWLE(c, c->guilds_lock)) {rs = -7; goto rc;} cJSON_ArrayForEach(channel, json) { int skip = 0; - if (cJSON_IsArray(perms = cJSON_GetObjectItem(channel, "permission_overwrites"))); /* not supported */ + /* if (cJSON_IsArray(perms = cJSON_GetObjectItem(channel, "permission_overwrites"))); cJSON_ArrayForEach(perm, perms) { skip++; } - if (skip) continue; + if (skip) continue; */ char * topic = cJSON_GetStringValue(cJSON_GetObjectItem(channel, "topic")); char * name = cJSON_GetStringValue(cJSON_GetObjectItem(channel, "name")); char * id = cJSON_GetStringValue(cJSON_GetObjectItem(channel, "id")); |