use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "0.1"; %IRSSI = ( authors => "Gavin Sharp", contact => "", name => "ignorehilight", description => "Ignore hilight messages in some cases", license => "MIT", changed => "2010-07-31" ); sub ignore_hilight { my ($dest, $text, $stripped) = @_; return unless ($dest->{level} & MSGLEVEL_HILIGHT); my $target = $dest->{target}; my @chanspecs = split(/,/, Irssi::settings_get_str('ignorehilight_chans')); foreach my $chanspec (@chanspecs) { my ($chan,$word) = split(/:/, $chanspec); if ($stripped =~ "$word" && $target eq $chan) { my $window = $dest->{window}; $window->print($text, MSGLEVEL_PUBLIC); Irssi::signal_stop(); } } } Irssi::signal_add_first('print text', 'ignore_hilight'); Irssi::settings_add_str($IRSSI{'name'}, 'ignorehilight_chans', '');