aboutsummaryrefslogtreecommitdiff
path: root/idalius.pl
diff options
context:
space:
mode:
Diffstat (limited to 'idalius.pl')
-rwxr-xr-xidalius.pl13
1 files changed, 12 insertions, 1 deletions
diff --git a/idalius.pl b/idalius.pl
index d998b97..e620ff7 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -30,7 +30,7 @@ $irc->plugin_add('NickServID', POE::Component::IRC::Plugin::NickServID->new(
POE::Session->create(
package_states => [
- main => [ qw(_default _start irc_001 irc_kick irc_ctcp_action irc_public irc_msg irc_nick) ],
+ main => [ qw(_default _start irc_001 irc_kick irc_ctcp_action irc_public irc_msg irc_nick irc_disconnected ) ],
],
heap => { irc => $irc },
);
@@ -163,9 +163,20 @@ sub irc_msg {
$irc->yield(privmsg => $nick => "Syntax: say <channel> <msg>");
}
}
+ if ($what =~ /^reconnect/) {
+ my ($reason) = $what =~ /^reconnect\s+(.+)$/;
+ if (!$reason) {
+ $reason = $config{quit_msg};
+ }
+ $irc->yield(quit => $reason);
+ }
return;
}
+sub irc_disconnected {
+ $irc->yield(connect => { });
+}
+
sub _default {
my ($event, $args) = @_[ARG0 .. $#_];
my @output = ( "$event: " );