brmd: Try to deal with IRC disconnects gracefully

This commit is contained in:
Petr Baudis 2011-03-11 03:01:58 +01:00
parent 364c556f08
commit ac70e3ef7c

View file

@ -2,7 +2,7 @@
use strict; use strict;
use warnings; use warnings;
use POE qw(Component::IRC Component::Client::TCP Component::Server::HTTP); use POE qw(Component::IRC Component::IRC::Plugin::Connector Component::Client::TCP Component::Server::HTTP);
use HTTP::Status qw/RC_OK/; use HTTP::Status qw/RC_OK/;
our $channel = "#brmlab"; our $channel = "#brmlab";
@ -51,6 +51,8 @@ sub _start {
my $irc = $heap->{irc}; my $irc = $heap->{irc};
$irc->yield( register => 'all' ); $irc->yield( register => 'all' );
$heap->{connector} = POE::Component::IRC::Plugin::Connector->new();
$irc->plugin_add( 'Connector' => $heap->{connector} );
$irc->yield( connect => { } ); $irc->yield( connect => { } );
} }