1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-16 06:25:24 +00:00

Merge pull request #1087 from ailin-nemui/time-expando-override

make the $Z time overridable
This commit is contained in:
ailin-nemui 2019-08-13 18:07:47 +02:00 committed by GitHub
commit fa0ecb688d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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