Skip to content

Commit

Permalink
Adding hilight_notice.pl.
Browse files Browse the repository at this point in the history
  • Loading branch information
msparks committed Jan 22, 2009
1 parent 5b7eec2 commit e3caab5
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions hilight_notice.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# hilight_notice.pl for irssi
#
# This script changes the message level for notices to the level used by private
# messages. Notices go to the status window by default, so when this script is
# loaded, the status window will be hilighted like a query window.
#
# Based off of active_notice.pl by Geert.

use strict;
use Irssi;

use vars qw($VERSION %IRSSI);

$VERSION = '1.1';
%IRSSI = (
authors => 'Matt "f0rked" Sparks',
contact => 'ms+irssi@quadpoint.org',
name => 'hilight_notice',
description => 'hilight status window on notices',
license => 'GPLv2',
url => 'http://quadpoint.org',
changed => '2006-12-15',
);


sub hilight_notice
{
my ($dest, $text, $stripped) = @_;
my $server = $dest->{server};

return if (!$server || !($dest->{level} & MSGLEVEL_NOTICES));

# Change the message level to level used by PRIVMSGs
my $witem = $server->window_item_find($dest->{target});
$witem->print($text, MSGLEVEL_MSGS) if $witem;
Irssi::print($text, MSGLEVEL_MSGS) if !$witem;
Irssi::signal_stop();
}


Irssi::signal_add("print text", "hilight_notice");

0 comments on commit e3caab5

Please sign in to comment.