From: martin f. krafft Date: Wed, 27 May 2009 08:48:56 +0000 (+0200) Subject: simplify level assignment X-Git-Url: https://git.madduck.net/code/irssi/scripts-bc-bd.git/commitdiff_plain/596b9f613b12751a949f361da959d0e64ad5db21 simplify level assignment Signed-off-by: martin f. krafft --- diff --git a/chanact.pl b/chanact.pl index 3d44b94..44b071a 100644 --- a/chanact.pl +++ b/chanact.pl @@ -257,13 +257,12 @@ sub remake() { $match_windowlist ||= grep { $_ eq '@QUERIES' } @windowlist; } - my $filter_level = Irssi::settings_get_int('chanact_filter'); - if ($match_windowlist) { - # window matches windowlist so use - # chanact_filter_windowlist_level to override - # chanact_filter - $filter_level = Irssi::settings_get_int('chanact_filter_windowlist_level'); - } + # choose filter_level according to whether the window is in + # the windowlist + my $filter_level = $match_windowlist + ? Irssi::settings_get_int('chanact_filter_windowlist_level') + : Irssi::settings_get_int('chanact_filter'); + # skip windows with data of level lower than the applicable # filter setting next if ($win->{data_level} < $filter_level);