1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 16:16: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 int store_data(Tox *m, char *path);
extern int num_groupchats;
static void chat_onMessage(ToxWindow *self, Tox *m, int num, uint8_t *msg, uint16_t len)
{
@ -225,9 +226,7 @@ static void chat_onGroupInvite(ToxWindow *self, Tox *m, int friendnumber, uint8_
wprintw(ctx->history, "%s has invited you to a group chat.\n", name);
int ngc = get_num_groupchats();
if (ngc < 0 || ngc > MAX_GROUPCHAT_NUM) {
if (num_groupchats >= MAX_GROUPCHAT_NUM) {
wprintw(ctx->history, "Maximum number of group chats has been reached. Discarding invite.\n");
return;
}