# based on hilightwin.pl, from Timo Sirainen
#
# spécial dedicace to Ann

use Irssi;
use vars qw($VERSION %IRSSI); 
$VERSION = '$Id: beep.pl 93 2003-12-28 21:19:29Z misc $';
%IRSSI = (
	authors	=> "Michael scherer",
	contact	=> "misc\@ephaone.org", 
	name	=> "beep",
	description	=> "Beep when hilighted messages & private messages",
	license	=> "Public Domain",
	url		=> "http://crovax.ephaone.org/~misc/",
);

sub sig_printtext {
	my ($dest, $text, $stripped) = @_;

	if (($dest->{level} & (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS)) &&
		(($dest->{level} & MSGLEVEL_NOHILIGHT) == 0) &&
		Irssi::settings_get_bool('beep_on_highlight')) {
			system Irssi::settings_get_str('beep_cmd') ;
	}
}

Irssi::settings_add_bool('lookandfeel', 'beep_on_highlight', 1);
Irssi::settings_add_str('lookandfeel', 'beep_cmd', 'beep');
Irssi::signal_add('print text', 'sig_printtext');
#startup info:
Irssi::print("Hightlight beeper by misc * http://crovax.ephaone.org/~misc/beep.pl");
Irssi::print("Version: $VERSION");
