1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 20:06:45 +02:00

fix window related bugs and warn user when max window limit has been reached

This commit is contained in:
Jfreegman
2013-11-30 05:35:25 -05:00
parent 8ff907d719
commit f6a6aecaf5
8 changed files with 101 additions and 39 deletions

View File

@ -18,8 +18,7 @@
extern char *DATA_FILE;
extern int store_data(Tox *m, char *path);
static GroupChat groupchats[MAX_GROUPCHAT_NUM];
int num_groupchats = 0;
static GroupChat groupchats[MAX_WINDOWS_NUM];
static int max_groupchat_index = 0;
int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum)
@ -42,8 +41,6 @@ int init_groupchat_win(ToxWindow *prompt, Tox *m, int groupnum)
if (i == max_groupchat_index)
++max_groupchat_index;
++num_groupchats;
return 0;
}
}
@ -66,7 +63,6 @@ static void close_groupchatwin(Tox *m, int groupnum)
break;
}
--num_groupchats;
max_groupchat_index = i;
}
@ -354,6 +350,8 @@ ToxWindow new_group_chat(Tox *m, int groupnum)
ToxWindow ret;
memset(&ret, 0, sizeof(ret));
ret.active = true;
ret.onKey = &groupchat_onKey;
ret.onDraw = &groupchat_onDraw;
ret.onInit = &groupchat_onInit;