From 9089ea2365fcd8dbf52386c54d3f3561d3931d90 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 2 Feb 2002 01:38:58 +0000 Subject: [PATCH] Replaced /SET msgs_timestamps with /SET timestamp_level, defaults to ALL. /SET timestamps must be ON for timestamp_level to have any effect. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2369 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-common-core.c | 2 +- src/fe-common/core/formats.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c index fc7598d0..6b57098a 100644 --- a/src/fe-common/core/fe-common-core.c +++ b/src/fe-common/core/fe-common-core.c @@ -154,7 +154,7 @@ void fe_common_core_init(void) args_register(options); settings_add_bool("lookandfeel", "timestamps", TRUE); - settings_add_bool("lookandfeel", "msgs_timestamps", FALSE); + settings_add_str("lookandfeel", "timestamp_level", "ALL"); settings_add_int("lookandfeel", "timestamp_timeout", 0); settings_add_bool("lookandfeel", "bell_beeps", FALSE); diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c index 65b54ce6..6ae23a2e 100644 --- a/src/fe-common/core/formats.c +++ b/src/fe-common/core/formats.c @@ -40,7 +40,7 @@ static const char *format_boldfores = "KBGCRMYW"; static int signal_gui_print_text; static int hide_text_style, hide_server_tags, hide_mirc_colors; -static int timestamps, msgs_timestamps; +static int timestamp_level; static int timestamp_timeout; int format_find_tag(const char *module, const char *tag) @@ -575,16 +575,13 @@ char *format_get_level_tag(THEME_REC *theme, TEXT_DEST_REC *dest) return format_get_text_theme(theme, MODULE_NAME, dest, format); } -#define show_timestamp(level) \ - (timestamps || (msgs_timestamps && ((level) & MSGLEVEL_MSGS))) - static char *get_timestamp(THEME_REC *theme, TEXT_DEST_REC *dest, time_t t) { char *format, str[256]; struct tm *tm; int diff; - if (!show_timestamp(dest->level)) + if ((timestamp_level & dest->level) == 0) return NULL; /* check for flags if we want to override defaults */ @@ -1047,11 +1044,15 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text) static void read_settings(void) { + timestamp_level = settings_get_bool("timestamps") ? MSGLEVEL_ALL : 0; + if (timestamp_level > 0) { + timestamp_level = + level2bits(settings_get_str("timestamp_level")); + } + timestamp_timeout = settings_get_int("timestamp_timeout"); + hide_server_tags = settings_get_bool("hide_server_tags"); hide_text_style = settings_get_bool("hide_text_style"); - timestamps = settings_get_bool("timestamps"); - timestamp_timeout = settings_get_int("timestamp_timeout"); - msgs_timestamps = settings_get_bool("msgs_timestamps"); hide_mirc_colors = settings_get_bool("hide_mirc_colors"); }