1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-03 12:16:44 +02:00

Add support for custom timestamps in chat and logs.

Internal representations of the time_format setting are replaced by timestamp format strings.
time_format is only used in the setup.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Loui Chang
2015-02-19 18:20:38 -05:00
parent d6c57c7aa3
commit 53e4b2c971
10 changed files with 77 additions and 30 deletions

View File

@ -202,7 +202,7 @@ void line_info_add(ToxWindow *self, const char *timestr, const char *name1, cons
if (timestr) {
snprintf(new_line->timestr, sizeof(new_line->timestr), "%s", timestr);
len += strlen(new_line->timestr);
len += strlen(new_line->timestr) + 1;
}
if (name1) {
@ -302,7 +302,7 @@ void line_info_print(ToxWindow *self)
case OUT_MSG_READ:
case IN_MSG:
wattron(win, COLOR_PAIR(BLUE));
wprintw(win, "%s", line->timestr);
wprintw(win, "%s ", line->timestr);
wattroff(win, COLOR_PAIR(BLUE));
int nameclr = GREEN;
@ -342,7 +342,7 @@ void line_info_print(ToxWindow *self)
case OUT_ACTION:
case IN_ACTION:
wattron(win, COLOR_PAIR(BLUE));
wprintw(win, "%s", line->timestr);
wprintw(win, "%s ", line->timestr);
wattroff(win, COLOR_PAIR(BLUE));
wattron(win, COLOR_PAIR(YELLOW));
@ -366,7 +366,7 @@ void line_info_print(ToxWindow *self)
case SYS_MSG:
if (line->timestr[0]) {
wattron(win, COLOR_PAIR(BLUE));
wprintw(win, "%s", line->timestr);
wprintw(win, "%s ", line->timestr);
wattroff(win, COLOR_PAIR(BLUE));
}
@ -399,7 +399,7 @@ void line_info_print(ToxWindow *self)
case CONNECTION:
wattron(win, COLOR_PAIR(BLUE));
wprintw(win, "%s", line->timestr);
wprintw(win, "%s ", line->timestr);
wattroff(win, COLOR_PAIR(BLUE));
wattron(win, COLOR_PAIR(line->colour));
@ -416,7 +416,7 @@ void line_info_print(ToxWindow *self)
case DISCONNECTION:
wattron(win, COLOR_PAIR(BLUE));
wprintw(win, "%s", line->timestr);
wprintw(win, "%s ", line->timestr);
wattroff(win, COLOR_PAIR(BLUE));
wattron(win, COLOR_PAIR(line->colour));
@ -433,7 +433,7 @@ void line_info_print(ToxWindow *self)
case NAME_CHANGE:
wattron(win, COLOR_PAIR(BLUE));
wprintw(win, "%s", line->timestr);
wprintw(win, "%s ", line->timestr);
wattroff(win, COLOR_PAIR(BLUE));
wattron(win, COLOR_PAIR(MAGENTA));