html/showhilight.pl
1 # Print hilighted messages with MSGLEVEL_PUBLIC to active window
2 # for irssi 0.7.99 by Pawe³ 'Styx' Chuchma³a based on hilightwin.pl by Timo Sirainen
3 use Irssi;
4 use vars qw($VERSION %IRSSI);
5 $VERSION = "0.1";
6 %IRSSI = (
7 authors => "Pawe³ \'Styx\' Chuchma³a",
8 contact => "styx\@irc.pl",
9 name => "showhilight",
10 description => "Show hilight messages in active window",
11 license => "GNU GPLv2",
12 changed => "Fri Jun 28 11:09:42 CET 2002"
13
14 );
15
16 sub sig_printtext {
17 my ($dest, $text, $stripped) = @_;
18
19 my $window = Irssi::active_win();
20
21 if (($dest->{level} & MSGLEVEL_HILIGHT) && ($dest->{level} & MSGLEVEL_PUBLIC) &&
22 ($window->{refnum} != $dest->{window}->{refnum}) && ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0) {
23
24 $text = $dest->{target}.":%K[".Irssi::settings_get_str(hilight_color).$dest->{window}->{refnum}."%K]:".$text;
25
26 $window->print($text, MSGLEVEL_CLIENTCRAP);
27 }
28 }
29
30 Irssi::signal_add('print text', 'sig_printtext');