1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Make it possible to only autolog saved channels

This commit is contained in:
vague666 2018-10-27 16:08:36 +02:00
parent 524f31b026
commit 2093530e75

View File

@ -41,6 +41,8 @@
#include "printtext.h" #include "printtext.h"
#include "fe-common-core.h" #include "fe-common-core.h"
#include "channels-setup.h"
/* close autologs after 5 minutes of inactivity */ /* close autologs after 5 minutes of inactivity */
#define AUTOLOG_INACTIVITY_CLOSE (60*5) #define AUTOLOG_INACTIVITY_CLOSE (60*5)
@ -486,6 +488,10 @@ static void autolog_open_check(TEXT_DEST_REC *dest)
deftarget = server ? server->nick : "unknown"; deftarget = server ? server->nick : "unknown";
/* log only channels that have been saved to the config */
if (settings_get_bool("autolog_only_saved_channels") && channel_setup_find(target, server_tag) == NULL)
return;
if (autolog_ignore_targets != NULL && if (autolog_ignore_targets != NULL &&
strarray_find_dest(autolog_ignore_targets, dest)) strarray_find_dest(autolog_ignore_targets, dest))
return; return;
@ -722,6 +728,7 @@ void fe_log_init(void)
settings_add_bool("log", "awaylog_colors", TRUE); settings_add_bool("log", "awaylog_colors", TRUE);
settings_add_bool("log", "autolog", FALSE); settings_add_bool("log", "autolog", FALSE);
settings_add_bool("log", "autolog_colors", FALSE); settings_add_bool("log", "autolog_colors", FALSE);
settings_add_bool("log", "autolog_only_saved_channels", FALSE);
settings_add_str("log", "autolog_path", "~/irclogs/$tag/$0.log"); settings_add_str("log", "autolog_path", "~/irclogs/$tag/$0.log");
settings_add_level("log", "autolog_level", "all -crap -clientcrap -ctcps"); settings_add_level("log", "autolog_level", "all -crap -clientcrap -ctcps");
settings_add_str("log", "log_theme", ""); settings_add_str("log", "log_theme", "");