1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 01:53:02 +01:00
This commit is contained in:
Jfreegman 2013-09-22 00:07:59 -04:00
parent eea27e72ca
commit 2892f71877

View File

@ -253,12 +253,19 @@ void cmd_join(WINDOW *window, ToxWindow *prompt, Tox *m, int argc, char **argv)
int num = atoi(argv[1]);
if (num < 0 || num >= num_grp_requests) {
wprintw(window, "No pending group chat invites with that number.\n");
if (num < 0 || num >= MAX_FRIENDS_NUM) {
wprintw(window, "Invalid number.\n");
return;
}
int groupnum = tox_join_groupchat(m, num, pending_grp_requests[num]);
uint8_t *groupkey = pending_grp_requests[num];
if (!groupkey || !strlen(groupkey)) {
wprintw(window, "No group chat request with that number.\n");
return;
}
int groupnum = tox_join_groupchat(m, num, groupkey);
if (groupnum == -1) {
wprintw(window, "Group chat failed to initialize.\n");