aboutsummaryrefslogtreecommitdiff
path: root/idalius.pl
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-08-30 13:56:36 +1200
committerDavid Phillips <david@sighup.nz>2017-08-30 13:59:34 +1200
commite8db6cdecd3f18133e318df63b463e4c5c2adfc4 (patch)
tree10a557962408532331bf7b4250aceb7856383817 /idalius.pl
parent5f45cca86e4ac1e017b1a193ca87bc2326e116ce (diff)
downloadidalius-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-xidalius.pl6
1 files changed, 6 insertions, 0 deletions
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 => { });