blob: 127f5bcdd995af33ef63756fab8f0f1a5ee43e09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package Plugin::Rejoin;
use strict;
use warnings;
my $config;
my $root_config;
sub configure {
my $self = shift;
shift; # cmdref
shift; # run_command
$config = shift;
$root_config = shift;
return $self;
}
sub on_kick {
my ($self, $logger, $kicker, $where, $kickee, $why, $irc) = @_;
if ($kickee eq $irc->nick_name) {
$logger->("I was kicked from $where. Rejoining now...");
$irc->yield(join => $where);
}
return;
}
sub on_invite {
my ($self, $logger, $who, $where, $irc) = @_;
$irc->yield(join => $where) if (grep {$_ eq $where} @{$root_config->{channels}});
return;
}
1;
|