]>
jfr.im git - irssi-scripts.git/blob - active_notice.pl
3 ## Bugreports and Licence disclaimer.
5 # For bugreports and other improvements contact Geert Hauwaerts <geert@irssi.org>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this script; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 use vars
qw($VERSION %IRSSI);
30 authors
=> 'Geert Hauwaerts',
31 contact
=> 'geert@irssi.org',
32 name
=> 'active_notice.pl',
33 description
=> 'This script shows notices into the active channel unless it has its own window.',
34 license
=> 'GNU General Public License',
35 url
=> 'http://irssi.hauwaerts.be/active_notice.pl',
36 changed
=> 'Wed Sep 17 23:00:11 CEST 2003',
39 Irssi
::theme_register
([
40 'active_notice_loaded', '%R>>%n %_Scriptinfo:%_ Loaded $0 version $1 by $2.'
45 my ($dest, $text, $stripped) = @_;
46 my $server = $dest->{server
};
48 return if (!$server || !($dest->{level
} & MSGLEVEL_NOTICES
) || $server->ischannel($dest->{target
}));
50 my $witem = $server->window_item_find($dest->{target
});
51 my $awin = Irssi
::active_win
();
55 $awin->print($text, MSGLEVEL_NOTICES
);
60 Irssi
::signal_add
('print text', 'notice_move');
61 Irssi
::printformat
(MSGLEVEL_CLIENTCRAP
, 'active_notice_loaded', $IRSSI{name
}, $VERSION, $IRSSI{authors
});