1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 05:13:03 +01:00

> not having green text

This commit is contained in:
Jfreegman 2013-09-26 00:33:51 -04:00
parent 80c7b07f2e
commit 39fc54972a
3 changed files with 22 additions and 4 deletions

View File

@ -35,6 +35,12 @@ static void chat_onMessage(ToxWindow *self, Tox *m, int num, uint8_t *msg, uint1
wattron(ctx->history, COLOR_PAIR(4)); wattron(ctx->history, COLOR_PAIR(4));
wprintw(ctx->history, "%s: ", nick); wprintw(ctx->history, "%s: ", nick);
wattroff(ctx->history, COLOR_PAIR(4)); wattroff(ctx->history, COLOR_PAIR(4));
if (msg[0] == '>') {
wattron(ctx->history, COLOR_PAIR(GREEN));
wprintw(ctx->history, "%s\n", msg);
wattroff(ctx->history, COLOR_PAIR(GREEN));
} else
wprintw(ctx->history, "%s\n", msg); wprintw(ctx->history, "%s\n", msg);
self->blink = true; self->blink = true;
@ -219,6 +225,12 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
wattron(ctx->history, COLOR_PAIR(GREEN)); wattron(ctx->history, COLOR_PAIR(GREEN));
wprintw(ctx->history, "%s: ", selfname); wprintw(ctx->history, "%s: ", selfname);
wattroff(ctx->history, COLOR_PAIR(GREEN)); wattroff(ctx->history, COLOR_PAIR(GREEN));
if (line[0] == '>') {
wattron(ctx->history, COLOR_PAIR(GREEN));
wprintw(ctx->history, "%s\n", line);
wattroff(ctx->history, COLOR_PAIR(GREEN));
} else
wprintw(ctx->history, "%s\n", line); wprintw(ctx->history, "%s\n", line);
if (!statusbar->is_online if (!statusbar->is_online

View File

@ -112,6 +112,12 @@ static void groupchat_onGroupMessage(ToxWindow *self, Tox *m, int groupnum, int
wattron(ctx->history, COLOR_PAIR(4)); wattron(ctx->history, COLOR_PAIR(4));
wprintw(ctx->history, "%s: ", nick); wprintw(ctx->history, "%s: ", nick);
wattroff(ctx->history, COLOR_PAIR(4)); wattroff(ctx->history, COLOR_PAIR(4));
if (msg[0] == '>') {
wattron(ctx->history, COLOR_PAIR(GREEN));
wprintw(ctx->history, "%s\n", msg);
wattroff(ctx->history, COLOR_PAIR(GREEN));
} else
wprintw(ctx->history, "%s\n", msg); wprintw(ctx->history, "%s\n", msg);
self->blink = true; self->blink = true;

View File

@ -19,7 +19,7 @@ uint8_t num_frnd_requests = 0;
/* One group chat request slot for each friend; slot is /* One group chat request slot for each friend; slot is
overwritten on subsequent requests by the same friend. */ overwritten on subsequent requests by the same friend. */
uint8_t pending_grp_requests[MAX_FRIENDS_NUM][TOX_CLIENT_ID_SIZE] = {'\0'}; uint8_t pending_grp_requests[MAX_FRIENDS_NUM][TOX_CLIENT_ID_SIZE] = {'a'};
static char prompt_buf[MAX_STR_SIZE] = {'\0'}; static char prompt_buf[MAX_STR_SIZE] = {'\0'};
static int prompt_buf_pos = 0; static int prompt_buf_pos = 0;