summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@irssi.org>2009-07-22 19:45:51 +0000
committerahf <ahf@dbcabf3a-b0e7-0310-adc4-f8d773084564>2009-07-22 19:45:51 +0000
commit7b81897287f8515c142cf0b946ee4e6e465ba162 (patch)
tree189ebea0b27318e090609e22e5634c568ad109ba /src/fe-common
parent13edcc2ad110f89f75cb0d5ada8ecdc8519b8349 (diff)
downloadirssi-7b81897287f8515c142cf0b946ee4e6e465ba162.zip
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
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-log.c18
1 files 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;