From e8db6cdecd3f18133e318df63b463e4c5c2adfc4 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 30 Aug 2017 13:56:36 +1200 Subject: Join configured channels when invited to them When invited by anyone to join a channel which the bot is supposed to be auto-joined to, the bot will now attempt to join that channel once, automatically. Useful for if an operator without bot access removes or otherwise excludes the bot from the channel such that the polite auto-rejoin fails to join the bot back to the channel, any operator from that channel can still bring the bot back into the channel with an invitation. Implements #8 --- idalius.pl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'idalius.pl') diff --git a/idalius.pl b/idalius.pl index 3bf21f8..9529c67 100755 --- a/idalius.pl +++ b/idalius.pl @@ -51,6 +51,7 @@ POE::Session->create( irc_ctcp_action irc_public irc_msg + irc_invite irc_nick irc_disconnected irc_error @@ -192,6 +193,11 @@ sub irc_msg { return; } +sub irc_invite { + my ($who, $where) = @_[ARG0 .. ARG1]; + $irc->yield(join => $where) if (grep {$_ eq $where} @{$config{channels}}); +} + sub irc_disconnected { %config = config_file::parse_config($config_file); $irc->yield(connect => { }); -- cgit v1.1