1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

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
This commit is contained in:
Alexander Færøy 2009-07-22 19:45:51 +00:00 committed by ahf
parent 13edcc2ad1
commit 7b81897287

View File

@ -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;