diff --git a/src/global_commands.c b/src/global_commands.c index a513115..9d5d2e6 100644 --- a/src/global_commands.c +++ b/src/global_commands.c @@ -400,12 +400,14 @@ void cmd_join(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv)[MA id_bin[i] = x; } - if (tox_group_new_join(m, (uint8_t *) id_bin) == -1) { + int groupnum = tox_group_new_join(m, (uint8_t *) id_bin); + + if (groupnum == -1) { line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat instance failed to initialize."); return; } - if (init_groupchat_win(prompt, m, self->num, NULL, 0) == -1) { + if (init_groupchat_win(prompt, m, groupnum, NULL, 0) == -1) { line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Group chat window failed to initialize."); tox_group_delete(m, self->num, NULL, 0); return; diff --git a/src/group_commands.c b/src/group_commands.c index 8f54c2a..3692c8a 100644 --- a/src/group_commands.c +++ b/src/group_commands.c @@ -67,7 +67,7 @@ void cmd_set_topic(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg int sn_len = tox_group_get_self_name(m, self->num, (uint8_t *) selfnick); selfnick[sn_len] = '\0'; - line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, " set the group topic to: %s", topic); + line_info_add(self, timefrmt, selfnick, NULL, SYS_MSG, 0, 0, " set the group topic to: %s", topic); char tmp_event[MAX_STR_SIZE]; snprintf(tmp_event, sizeof(tmp_event), "set topic to %s", topic);