Created
February 10, 2011 15:30
-
-
Save miek/820714 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Print hilighted messages & private messages to window named "hilight" for | |
# irssi 0.7.99 by Timo Sirainen | |
# | |
# Modded a tiny bit by znx to stop private messages entering the hilighted | |
# window (can be toggled) and to put up a timestamp. | |
# | |
use Irssi; | |
use vars qw($VERSION %IRSSI); | |
$VERSION = "0.02"; | |
%IRSSI = ( | |
authors => "Timo \'cras\' Sirainen, Mark \'znx\' Sangster", | |
contact => "tss\@iki.fi, znxster\@gmail.com", | |
name => "hilightwin", | |
description => "Print hilighted messages to window named \"hilight\"", | |
license => "Public Domain", | |
url => "http://irssi.org/", | |
changed => "Sun May 25 18:59:57 BST 2008" | |
); | |
sub sig_printtext { | |
my ($dest, $text, $stripped) = @_; | |
my $opt = MSGLEVEL_HILIGHT; | |
if(Irssi::settings_get_bool('hilightwin_showprivmsg')) { | |
$opt = MSGLEVEL_HILIGHT|MSGLEVEL_MSGS; | |
} | |
if( | |
($dest->{level} & ($opt)) && | |
($dest->{level} & MSGLEVEL_NOHILIGHT) == 0 | |
) { | |
$window = Irssi::window_find_name('hilight'); | |
for my $w (split(' ', Irssi::settings_get_str('activity_hide_targets'))) { | |
if ($w eq $dest->{target}) { | |
return; | |
} | |
} | |
if ($dest->{level} & MSGLEVEL_PUBLIC) { | |
$text = $dest->{target}.": ".$text; | |
} | |
$window->print($text, MSGLEVEL_NEVER) if ($window); | |
} | |
} | |
$window = Irssi::window_find_name('hilight'); | |
Irssi::print("Create a window named 'hilight'") if (!$window); | |
Irssi::settings_add_bool('hilightwin','hilightwin_showprivmsg',1); | |
Irssi::signal_add('print text', 'sig_printtext'); | |
# vim:set ts=4 sw=4 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment