1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-06 03:27:56 +02: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]); int num = atoi(argv[1]);
if (num < 0 || num >= num_grp_requests) { if (num < 0 || num >= MAX_FRIENDS_NUM) {
wprintw(window, "No pending group chat invites with that number.\n"); wprintw(window, "Invalid number.\n");
return; 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) { if (groupnum == -1) {
wprintw(window, "Group chat failed to initialize.\n"); wprintw(window, "Group chat failed to initialize.\n");