1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-15 14:06:34 +01:00

Merge with upstream master

This commit is contained in:
Jfreegman
2015-11-10 23:52:54 -05:00
23 changed files with 373 additions and 82 deletions

View File

@@ -70,9 +70,9 @@ extern struct user_settings *user_settings;
extern struct Winthread Winthread;
#ifdef AUDIO
#define AC_NUM_GROUP_COMMANDS 41
#define AC_NUM_GROUP_COMMANDS 42
#else
#define AC_NUM_GROUP_COMMANDS 37
#define AC_NUM_GROUP_COMMANDS 38
#endif /* AUDIO */
/* groupchat command names used for tab completion. */
@@ -96,6 +96,7 @@ static const char group_cmd_list[AC_NUM_GROUP_COMMANDS][MAX_CMDNAME_SIZE] = {
{ "/mod" },
{ "/myid" },
{ "/mykey" },
{ "/myqr" },
{ "/nick" },
{ "/note" },
{ "/passwd" },
@@ -402,6 +403,9 @@ void redraw_groupchat_win(ToxWindow *self)
getmaxyx(stdscr, y2, x2);
y2 -= 2;
if (y2 <= 0 || x2 <= 0)
return;
if (ctx->sidebar) {
delwin(ctx->sidebar);
ctx->sidebar = NULL;
@@ -1055,7 +1059,7 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
getyx(self->window, y, x);
getmaxyx(self->window, y2, x2);
if (x2 <= 0)
if (x2 <= 0 || y2 <= 0)
return;
if (self->help->active) {
@@ -1148,6 +1152,9 @@ static void groupchat_onDraw(ToxWindow *self, Tox *m)
int x2, y2;
getmaxyx(self->window, y2, x2);
if (x2 <= 0 || y2 <= 0)
return;
ChatContext *ctx = self->chatwin;
GroupChat *chat = &groupchats[self->num];
@@ -1250,6 +1257,9 @@ static void groupchat_onInit(ToxWindow *self, Tox *m)
int x2, y2;
getmaxyx(self->window, y2, x2);
if (x2 <= 0 || y2 <= 0)
exit_toxic_err("failed in groupchat_onInit", FATALERR_CURSES);
ChatContext *ctx = self->chatwin;
ctx->history = subwin(self->window, y2 - CHATBOX_HEIGHT + 1, x2 - SIDEBAR_WIDTH - 1, 0, 0);