1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-29 21:36:46 +02:00

simplify groupchat counter

This commit is contained in:
Jfreegman
2013-11-17 16:09:14 -05:00
parent 39f1587a6e
commit 73cc9bfcf2
4 changed files with 15 additions and 26 deletions

View File

@ -16,6 +16,7 @@ extern char *DATA_FILE;
extern uint8_t pending_frnd_requests[MAX_FRIENDS_NUM][TOX_CLIENT_ID_SIZE];
extern uint8_t num_frnd_requests;
extern int num_groupchats;
/* command functions */
void cmd_accept(WINDOW *window, ToxWindow *prompt, Tox *m, int num, int argc, char (*argv)[MAX_STR_SIZE])
@ -172,9 +173,7 @@ void cmd_connect(WINDOW *window, ToxWindow *prompt, Tox *m, int num, int argc, c
void cmd_groupchat(WINDOW *window, ToxWindow *prompt, Tox *m, int num, int argc, char (*argv)[MAX_STR_SIZE])
{
int ngc = get_num_groupchats();
if (ngc < 0 || ngc > MAX_GROUPCHAT_NUM) {
if (num_groupchats >= MAX_GROUPCHAT_NUM) {
wprintw(window, "\nMaximum number of group chats has been reached.\n");
return;
}