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:
parent
2cbe7e4ccb
commit
ddb6eee18d
@ -376,18 +376,18 @@ win_print(ProfWin *window, const char show_char, const char * const date_fmt,
|
|||||||
int offset = 0;
|
int offset = 0;
|
||||||
int colour = COLOUR_ME;
|
int colour = COLOUR_ME;
|
||||||
|
|
||||||
if ((flags & 2) == 0) {
|
if ((flags & NO_DATE) == 0) {
|
||||||
wattron(window->win, COLOUR_TIME);
|
wattron(window->win, COLOUR_TIME);
|
||||||
wprintw(window->win, "%s %c ", date_fmt, show_char);
|
wprintw(window->win, "%s %c ", date_fmt, show_char);
|
||||||
wattroff(window->win, COLOUR_TIME);
|
wattroff(window->win, COLOUR_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(from) > 0) {
|
if (strlen(from) > 0) {
|
||||||
if ((flags & 1) != 0) {
|
if ((flags & NO_ME) != 0) {
|
||||||
colour = COLOUR_THEM;
|
colour = COLOUR_THEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((flags & 8) != 0) {
|
if ((flags & NO_COLOUR_FROM) != 0) {
|
||||||
colour = 0;
|
colour = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ win_print(ProfWin *window, const char show_char, const char * const date_fmt,
|
|||||||
|
|
||||||
wattron(window->win, attrs);
|
wattron(window->win, attrs);
|
||||||
|
|
||||||
if ((flags & 4) == 0) {
|
if ((flags & NO_EOL) == 0) {
|
||||||
wprintw(window->win, "%s\n", message+offset);
|
wprintw(window->win, "%s\n", message+offset);
|
||||||
} else {
|
} else {
|
||||||
wprintw(window->win, "%s", message+offset);
|
wprintw(window->win, "%s", message+offset);
|
||||||
|
@ -35,8 +35,10 @@
|
|||||||
#include "ui/buffer.h"
|
#include "ui/buffer.h"
|
||||||
|
|
||||||
#define NO_ME 1
|
#define NO_ME 1
|
||||||
#define NO_EOL 4
|
|
||||||
#define NO_DATE 2
|
#define NO_DATE 2
|
||||||
|
#define NO_EOL 4
|
||||||
|
#define NO_COLOUR_FROM 8
|
||||||
|
|
||||||
#define NO_EOL_DATE 6
|
#define NO_EOL_DATE 6
|
||||||
|
|
||||||
#define PAD_SIZE 1000
|
#define PAD_SIZE 1000
|
||||||
|
Loading…
Reference in New Issue
Block a user