diff options
author | David Phillips <david@sighup.nz> | 2017-08-30 13:56:36 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-08-30 13:59:34 +1200 |
commit | e8db6cdecd3f18133e318df63b463e4c5c2adfc4 (patch) | |
tree | 10a557962408532331bf7b4250aceb7856383817 /idalius.pl | |
parent | 5f45cca86e4ac1e017b1a193ca87bc2326e116ce (diff) | |
download | idalius-e8db6cdecd3f18133e318df63b463e4c5c2adfc4.tar.xz |
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
Diffstat (limited to 'idalius.pl')
-rwxr-xr-x | idalius.pl | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 => { }); |