]>
git.sthu.org Git - shutils.git/blob - dotfiles/irssi/scripts/hilightwin.pl
2 # Print hilighted messages & private messages to window named "hilight" for
3 # irssi 0.7.99 by Timo Sirainen
5 # Modded a tiny bit by znx to stop private messages entering the hilighted
6 # window (can be toggled) and to put up a timestamp.
11 use vars
qw($VERSION %IRSSI);
15 authors => "Timo \'cras\' Sirainen, Mark \'znx\' Sangster",
16 contact => "tss\@iki.fi, znxster\@gmail.com",
18 description => "Print hilighted messages to window named \"hilight\"",
19 license => "Public Domain",
20 url => "http://irssi.org/",
21 changed => "Sun May 25 18:59:57 BST 2008"
25 my ($dest, $text, $stripped) = @_;
27 my $opt = MSGLEVEL_HILIGHT;
29 if(Irssi::settings_get_bool('hilightwin_showprivmsg')) {
30 $opt = MSGLEVEL_HILIGHT|MSGLEVEL_MSGS;
34 ($dest->{level} & ($opt)) &&
35 ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0
37 $window = Irssi::window_find_name('hilight');
39 if ($dest->{level} & MSGLEVEL_PUBLIC) {
40 $text = $dest->{target}.": ".$text;
43 Irssi::settings_get_str('timestamp_format')." ",
46 $window->print($text, MSGLEVEL_NEVER) if ($window);
50 $window = Irssi::window_find_name('hilight');
51 Irssi::print("Create a window named 'hilight'") if (!$window);
53 Irssi::settings_add_bool('hilightwin','hilightwin_showprivmsg',1);
55 Irssi::signal_add('print text', 'sig_printtext');
57 # vim:set ts=4 sw=4 et: