mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-25 08:43:02 +01:00
Fix some weird/incorrect code for printing private messages
This commit is contained in:
parent
2eeb1de20d
commit
812f2d1ff9
@ -658,32 +658,21 @@ void line_info_print(ToxWindow *self)
|
|||||||
line->name1);
|
line->name1);
|
||||||
wattroff(win, COLOR_PAIR(nameclr));
|
wattroff(win, COLOR_PAIR(nameclr));
|
||||||
|
|
||||||
char *msg = line->msg;
|
if (line->msg[0] == '>') {
|
||||||
|
|
||||||
while (msg) {
|
|
||||||
char *line = strsep(&msg, "\n");
|
|
||||||
|
|
||||||
if (line[0] == '>') {
|
|
||||||
wattron(win, COLOR_PAIR(GREEN));
|
wattron(win, COLOR_PAIR(GREEN));
|
||||||
} else if (line[0] == '<') {
|
} else if (line->msg[0] == '<') {
|
||||||
wattron(win, COLOR_PAIR(RED));
|
wattron(win, COLOR_PAIR(RED));
|
||||||
}
|
}
|
||||||
|
|
||||||
wprintw(win, "%s%c", line, msg ? '\n' : '\0');
|
print_wrap(win, line, max_x, max_y);
|
||||||
|
|
||||||
if (line[0] == '>') {
|
if (line->msg[0] == '>') {
|
||||||
wattroff(win, COLOR_PAIR(GREEN));
|
wattroff(win, COLOR_PAIR(GREEN));
|
||||||
} else if (line[0] == '<') {
|
} else if (line->msg[0] == '<') {
|
||||||
wattroff(win, COLOR_PAIR(RED));
|
wattroff(win, COLOR_PAIR(RED));
|
||||||
}
|
}
|
||||||
|
|
||||||
// change the \0 set by strsep back to \n
|
waddch(win, '\n');
|
||||||
if (msg) {
|
|
||||||
msg[-1] = '\n';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
wprintw(win, "\n", line->msg);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user