From 7b81897287f8515c142cf0b946ee4e6e465ba162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=C3=A6r=C3=B8y?= Date: Wed, 22 Jul 2009 19:45:51 +0000 Subject: [PATCH] Move the autolog_ignore_targets logic a bit around; fixes #673. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5080 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-log.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index 32086435..c7cf3aed 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -460,10 +460,13 @@ static void autolog_open(SERVER_REC *server, const char *server_tag, g_free(fname); } -static void autolog_open_check(SERVER_REC *server, const char *server_tag, - const char *target, int level) +static void autolog_open_check(TEXT_DEST_REC *dest) { const char *deftarget; + SERVER_REC *server = dest->server; + const char *server_tag = dest->server_tag; + const char *target = dest->target; + int level = dest->level; /* FIXME: kind of a kludge, but we don't want to reopen logs when we're parting the channel with /WINDOW CLOSE.. Maybe a small @@ -475,6 +478,10 @@ static void autolog_open_check(SERVER_REC *server, const char *server_tag, deftarget = server ? server->nick : "unknown"; + if (autolog_ignore_targets != NULL && + strarray_find_dest(autolog_ignore_targets, dest)) + return; + if (target != NULL) autolog_open(server, server_tag, strcmp(target, "*") ? target : deftarget); } @@ -504,13 +511,8 @@ static void log_line(TEXT_DEST_REC *dest, const char *text) if (dest->level == MSGLEVEL_NEVER) return; - if (autolog_ignore_targets != NULL && dest->target != NULL) - if (strarray_find_dest(autolog_ignore_targets, dest)) - return; - /* let autolog open the log records */ - autolog_open_check(dest->server, dest->server_tag, - dest->target, dest->level); + autolog_open_check(dest); if (logs == NULL) return;