1 # automatically rejoin to channel after kicked
3 # NOTE: I personally don't like this feature, in most channels I'm in it
4 # will just result as ban. You've probably misunderstood the idea of /KICK
5 # if you kick/get kicked all the time "just for fun" ...
11 sub event_rejoin_kick {
12 my ($server, $data) = @_;
13 my ($channel, $nick) = split(/ +/, $data);
15 return if ($server->{nick} ne $nick);
17 # check if channel has password
18 my $chanrec = $server->channel_find($channel);
19 my $password = $chanrec->{key} if ($chanrec);
21 # We have to use send_raw() because the channel record still
22 # exists and irssi won't even try to join to it with command()
23 $server->send_raw("JOIN $channel $password");
26 Irssi::signal_add('event kick', 'event_rejoin_kick');