From b3ab0bde053cd25868e6c466275d9ec47a6a56db Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Sun, 4 Jan 2015 17:22:24 -0500 Subject: [PATCH] a couple fixes --- src/global_commands.c | 6 ++++-- src/group_commands.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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);