summaryrefslogtreecommitdiffstats
path: root/src/h.c
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2021-09-16 22:08:05 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2021-09-16 22:08:05 +0200
commit5945af1f1b0f92877dd7e2fc959d95fa92d976f4 (patch)
treeadff7b17c12b7046df311e9aaef293ce53cef9a1 /src/h.c
parentsome bullshit i just saved (diff)
downloaddiscord.c-5945af1f1b0f92877dd7e2fc959d95fa92d976f4.tar
discord.c-5945af1f1b0f92877dd7e2fc959d95fa92d976f4.tar.gz
discord.c-5945af1f1b0f92877dd7e2fc959d95fa92d976f4.tar.bz2
discord.c-5945af1f1b0f92877dd7e2fc959d95fa92d976f4.tar.lz
discord.c-5945af1f1b0f92877dd7e2fc959d95fa92d976f4.tar.xz
discord.c-5945af1f1b0f92877dd7e2fc959d95fa92d976f4.tar.zst
discord.c-5945af1f1b0f92877dd7e2fc959d95fa92d976f4.zip
Diffstat (limited to 'src/h.c')
-rw-r--r--src/h.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/h.c b/src/h.c
index 3e47408..4463f01 100644
--- a/src/h.c
+++ b/src/h.c
@@ -155,12 +155,18 @@ enum dc_json_paths { /* lws reduces the following char array to uint8_t, so we c
DC_JSON_OP, /* packet type */
DC_JSON_S, /* packet sequence number */
DC_JSON_PING, /* interval */
+ DC_JSON_ME, /* never useful in path parser, but startswith() checks if we're in object */
+ DC_JSON_FRIEND, /* never useful in path parser, but startswith() checks if we're in object */
+ DC_JSON_DM, /* never useful in path parser, but startswith() checks if we're in object */
DC_JSON_PATHS_LENGTH
};
char * dc_json_paths[] = { /* array of paths we are interested in */
"op",
"s",
- "d.heartbeat_interval"
+ "d.heartbeat_interval",
+ "d.user",
+ "d.relationships[].user",
+ "d.private_channels[]"
};
struct dc_lws_pass { /* struct that is allocated for in dc_lws_cb unique per connection in void * us */
DC_STRUCT_PREFIX
@@ -324,6 +330,7 @@ struct dc_user {
short int discriminator;
enum dc_status status;
char * path; /* yesfree, internal, so parser knows what object this user is from */
+ struct dc_user * next; /* nofree, next friend in ll of friends, first is client->user->next */
};
struct dc_user * dc_user_init () {
struct dc_user * s = calloc(1, sizeof(*s));