From 4d2c0d8317590b014536956691546e7d651dc87d Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 2 Jul 2019 21:43:14 +1200 Subject: Rejoin: Fix join-on-invitation --- Plugin/Autojoin.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Plugin/Autojoin.pm') diff --git a/Plugin/Autojoin.pm b/Plugin/Autojoin.pm index 4288c42..01c4a87 100644 --- a/Plugin/Autojoin.pm +++ b/Plugin/Autojoin.pm @@ -20,4 +20,20 @@ sub on_001_welcome { $irc->yield(join => $_) for @{$config->{channels}}; return; } + +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} @{$config->{channels}}); + return; +} 1; -- cgit v1.1