]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
let fnotify reconfig on the fly
authorTyler Abair <redacted>
Tue, 26 Jan 2016 22:14:23 +0000 (17:14 -0500)
committerTyler Abair <redacted>
Tue, 26 Jan 2016 22:14:23 +0000 (17:14 -0500)
scripts/fnotify.pl

index 88bf93515fb661a961f356eb4bf37eaa02e0575d..83cc858e90ffaafbeae3dece46cfc2fde0a9b550 100644 (file)
@@ -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);
git clone https://git.99rst.org/PROJECT