1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

make the $Z time overridable

This commit is contained in:
ailin-nemui 2019-07-19 08:40:16 +02:00
parent f3e037f434
commit a865b07a67
2 changed files with 3 additions and 1 deletions

View File

@ -48,6 +48,7 @@ typedef struct {
} EXPANDO_REC;
const char *current_expando = NULL;
time_t current_time = (time_t)-1;
static int timer_tag;
@ -441,7 +442,7 @@ static char *expando_time(SERVER_REC *server, void *item, int *free_ret)
struct tm *tm;
char str[256];
now = time(NULL);
now = current_time != (time_t)-1 ? current_time : time(NULL);
tm = localtime(&now);
if (strftime(str, sizeof(str), timestamp_format, tm) == 0)

View File

@ -17,6 +17,7 @@ typedef char* (*EXPANDO_FUNC)
(SERVER_REC *server, void *item, int *free_ret);
extern const char *current_expando;
extern time_t current_time;
/* Create expando - overrides any existing ones.
... = signal, type, ..., NULL - list of signals that might change the