Call imcb_connected only after we parsed the whole READY message

Do not call imcb_connceted prematurely as it breaks group dms for
instance.

Signed-off-by: Artem Savkov <artem.savkov@gmail.com>
This commit is contained in:
Artem Savkov 2020-02-07 23:23:45 +01:00
parent 3a300cd417
commit 69e16be9d1
1 changed files with 3 additions and 3 deletions

View File

@ -901,9 +901,6 @@ gboolean discord_parse_message(struct im_connection *ic, gchar *buf, guint64 siz
}
}
dd->state = WS_READY;
imcb_connected(ic);
json_value *pcs = json_o_get(data, "private_channels");
if (pcs != NULL && pcs->type == json_array) {
for (int pcidx = 0; pcidx < pcs->u.array.length; pcidx++) {
@ -946,6 +943,9 @@ gboolean discord_parse_message(struct im_connection *ic, gchar *buf, guint64 siz
}
}
dd->state = WS_READY;
imcb_connected(ic);
} else if (g_strcmp0(event, "GUILD_SYNC") == 0) {
json_value *data = json_o_get(js, "d");
const char *id = json_o_str(data, "id");