From: Tyler Abair Date: Tue, 26 Jan 2016 22:14:23 +0000 (-0500) Subject: let fnotify reconfig on the fly X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=68cff155f150b1286b11f43e5267d19a524a0b7c;p=irssi-scripts.irssi.org.git let fnotify reconfig on the fly --- diff --git a/scripts/fnotify.pl b/scripts/fnotify.pl index 88bf935..83cc858 100644 --- a/scripts/fnotify.pl +++ b/scripts/fnotify.pl @@ -59,6 +59,12 @@ my %config; Irssi::settings_add_int('fnotify', 'fnotify_ignore_hilight' => -1); $config{'ignore_hilight'} = Irssi::settings_get_int('fnotify_ignore_hilight'); +Irssi::signal_add( + 'setup changed' => sub { + $config{'ignore_hilight'} = Irssi::settings_get_int('fnotify_ignore_hilight'); + } +); + # # catch private messages # @@ -75,7 +81,7 @@ sub priv_msg { sub hilight { my ($dest, $text, $stripped) = @_; my $ihl = $config{'ignore_hilight'}; - if ($dest->{level} & MSGLEVEL_HILIGHT && $dest->{hilight_priority} > $ihl) { + if ($dest->{level} & MSGLEVEL_HILIGHT && $dest->{hilight_priority} != $ihl) { my $server = $dest->{server}; my $network = $server->{tag}; filewrite($network . ' ' . $dest->{target} . ' ' . $stripped);