From bd6fe052bce57849a7a850c0c5bee0ad896b9460 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 28 Dec 2002 17:54:13 +0000 Subject: Added time, size and level setting types. Breaks some settings - I'll add automatic converter to these settings later. Meanwhile you CVS users can fix your config files yourself :) Time settings allow using "days", "hours", "minutes", "seconds" and "milliseconds" or several of their abbreviations. For example "5d 4h 5msecs". Size settings allow using "gbytes", "mbytes", "kbytes" and "bytes" or their abbrevations. For example "5MB". Level settings are currently handled pretty much the way they were before. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3080 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/log-away.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/core/log-away.c') diff --git a/src/core/log-away.c b/src/core/log-away.c index 724e4b4a..586d17d4 100644 --- a/src/core/log-away.c +++ b/src/core/log-away.c @@ -38,16 +38,13 @@ static void sig_log_written(LOG_REC *log) static void awaylog_open(void) { - const char *fname, *levelstr; + const char *fname; LOG_REC *log; int level; fname = settings_get_str("awaylog_file"); - levelstr = settings_get_str("awaylog_level"); - if (*fname == '\0' || *levelstr == '\0') return; - - level = level2bits(levelstr); - if (level == 0) return; + level = settings_get_level("awaylog_level"); + if (*fname == '\0' || level == 0) return; log = log_find(fname); if (log != NULL && log->handle != -1) @@ -106,7 +103,7 @@ void log_away_init(void) away_msgs = 0; settings_add_str("log", "awaylog_file", IRSSI_DIR_SHORT"/away.log"); - settings_add_str("log", "awaylog_level", "msgs hilight"); + settings_add_level("log", "awaylog_level", "msgs hilight"); signal_add("log written", (SIGNAL_FUNC) sig_log_written); signal_add("away mode changed", (SIGNAL_FUNC) sig_away_changed); -- cgit v1.2.3