Ticket #402: blquit.pl

File blquit.pl, 693 bytes (added by anonymous, at 2008-04-15T18:26:05Z)
Line 
1# log out bitlbee on quit, useful when you use an irc proxy such as bip.
2
3use Irssi;
4use Irssi::Irc;
5use strict;
6
7use vars qw($VERSION %IRSSI);
8
9$VERSION = "0.01";
10%IRSSI = (
11    authors     => 'Francois Lallart',
12    contact     => 'fraff@free.fr',
13    name        => 'blquit',
14    description => 'logout all bitlbee accounts on quit',
15    license     => 'GPLv2',
16);
17
18my $name = "&bitlbee";
19my $chan;
20
21sub bl_quit {
22    my ($data, $server, $channel) = @_;
23
24    foreach my $sv (Irssi::servers()) {
25        $chan = $sv->channel_find($name);
26
27        if ($chan) {
28            $sv->send_message ($chan->{"name"}, "account off all", 0);
29        }
30    }
31}
32
33
34Irssi::command_bind('quit', 'bl_quit');