#!/usr/bin/perl -w # status_notice.pl based on code for active_notice.pl by Geert Hauwaerts # # # Bugreports and Licence disclaimer. # # For bugreports and other improvements contact David Woodfall # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this script; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ## use strict; use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "0.2"; %IRSSI = ( authors => 'David Woodfall', contact => 'dave@dawoodfall.net', name => 'status_notice.pl', description => 'This script shows notices by chanserv in the status window.', license => 'GNU General Public License', url => 'http://dawoodfall.net/scripts/irssi/status_notice.pl', changed => 'Mon 8th March GMT 2010', ); sub notice_status { my ($dest, $text, $nick) = @_; my $server = $dest->{server}; return if (!$server || !($dest->{level} & MSGLEVEL_NOTICES) || $nick != "chanserv"); my $win = Irssi::window_find_name("(status)"); return if ! $win; $win->print($text, MSGLEVEL_NOTICES); Irssi::signal_stop(); } Irssi::signal_add('message public', 'notice_status');