1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Use constants for flags

This commit is contained in:
James Booth 2014-07-16 22:12:20 +01:00
parent 2cbe7e4ccb
commit ddb6eee18d
2 changed files with 7 additions and 5 deletions

View File

@ -376,18 +376,18 @@ win_print(ProfWin *window, const char show_char, const char * const date_fmt,
int offset = 0;
int colour = COLOUR_ME;
if ((flags & 2) == 0) {
if ((flags & NO_DATE) == 0) {
wattron(window->win, COLOUR_TIME);
wprintw(window->win, "%s %c ", date_fmt, show_char);
wattroff(window->win, COLOUR_TIME);
}
if (strlen(from) > 0) {
if ((flags & 1) != 0) {
if ((flags & NO_ME) != 0) {
colour = COLOUR_THEM;
}
if((flags & 8) != 0) {
if ((flags & NO_COLOUR_FROM) != 0) {
colour = 0;
}
@ -404,7 +404,7 @@ win_print(ProfWin *window, const char show_char, const char * const date_fmt,
wattron(window->win, attrs);
if ((flags & 4) == 0) {
if ((flags & NO_EOL) == 0) {
wprintw(window->win, "%s\n", message+offset);
} else {
wprintw(window->win, "%s", message+offset);

View File

@ -35,8 +35,10 @@
#include "ui/buffer.h"
#define NO_ME 1
#define NO_EOL 4
#define NO_DATE 2
#define NO_EOL 4
#define NO_COLOUR_FROM 8
#define NO_EOL_DATE 6
#define PAD_SIZE 1000