diff options
| author | ailin-nemui | 2016-01-27 09:13:28 +0100 |
|---|---|---|
| committer | ailin-nemui | 2016-01-27 09:13:28 +0100 |
| commit | 4370a9a3dd7016577aaa456fb1e00d0cf5efd32a (patch) | |
| tree | b4e80acfe03f18943b789a06f034f7a147cdba20 /scripts/fnotify.pl | |
| parent | b83e339fe1851a488c1b4550766f4a66d2880d5f (diff) | |
| parent | 68cff155f150b1286b11f43e5267d19a524a0b7c (diff) | |
| download | scripts.irssi.org-4370a9a3dd7016577aaa456fb1e00d0cf5efd32a.tar.bz2 | |
Merge pull request #228 from abair/fnotify_0.0.6
Fnotify 0.0.6
Diffstat (limited to 'scripts/fnotify.pl')
| -rw-r--r-- | scripts/fnotify.pl | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/scripts/fnotify.pl b/scripts/fnotify.pl index 5321ee8..83cc858 100644 --- a/scripts/fnotify.pl +++ b/scripts/fnotify.pl @@ -3,10 +3,11 @@ use warnings; use vars qw($VERSION %IRSSI); use Irssi; -$VERSION = '0.0.5'; +$VERSION = '0.0.6'; %IRSSI = ( name => 'fnotify', - authors => 'Thorsten Leemhuis, James Shubin, Serge van Ginderachter', + authors => 'Tyler Abair, Thorsten Leemhuis, James Shubin' . + ', Serge van Ginderachter', contact => 'fedora@leemhuis.info, serge@vanginderachter.be', description => 'Write notifications to a file in a consistent format.', license => 'GNU General Public License', @@ -20,11 +21,16 @@ $VERSION = '0.0.5'; # $ cp fnotify.pl ~/.irssi/scripts/fnotify.pl # irssi> /load perl # irssi> /script load fnotify +# irssi> /set fnotify_ignore_hilight 0 # ignore hilights of priority 0 # # # AUTHORS # +# Ignore hilighted messages with priority = fnotify_ignore_hilight +# version: 0.0.6 +# Tyler Abair <tyler.abair@gmail.com> +# # Strip non-parsed left over codes (Bitlbee otr messages) # version: 0.0.5 # Serge van Ginderachter <serge@vanginderachter.be> @@ -48,6 +54,17 @@ $VERSION = '0.0.5'; # http://fedora.feedjack.org/user/918/ # +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 # @@ -63,7 +80,8 @@ sub priv_msg { # sub hilight { my ($dest, $text, $stripped) = @_; - if ($dest->{level} & MSGLEVEL_HILIGHT) { + my $ihl = $config{'ignore_hilight'}; + if ($dest->{level} & MSGLEVEL_HILIGHT && $dest->{hilight_priority} != $ihl) { my $server = $dest->{server}; my $network = $server->{tag}; filewrite($network . ' ' . $dest->{target} . ' ' . $stripped); |
