--- trunk/bin/irc-logger.pl 2008/03/09 22:12:06 111 +++ trunk/bin/irc-logger.pl 2008/03/10 13:02:32 112 @@ -160,6 +160,13 @@ }, }; +# POE IRC +my $poe_irc = POE::Component::IRC->spawn( %$irc_config ) or + die "can't start ", dump( $irc_config ), ": $!"; + +my $irc = $poe_irc->session_id(); +_log "IRC session_id $irc"; + my $dbh = DBI->connect($DSN,"","", { RaiseError => 1, AutoCommit => 1 }) || die $DBI::errstr; $dbh->do( qq{ set client_encoding = 'UTF-8' } ); @@ -699,8 +706,8 @@ } my ( $type, $to ) = ( 'notice', $args->{channel} ); ( $type, $to ) = ( 'privmsg', $args->{nick} ) if $args->{private}; - _log(">> $type $to |", $msg); - $args->{kernel}->post( irc => $type => $to, $msg ); + _log(">> $type $to", $msg); + $args->{kernel}->post( $irc => $type => $to, $msg ); $updates++; } } @@ -750,16 +757,6 @@ # seed rss seen cache so we won't send out all items on startup _log rss_fetch_all; -# -# POE handing part -# - -my $poe_irc = POE::Component::IRC->spawn( %$irc_config ) or - die "can't start ", dump( $irc_config ), ": $!"; - -my $irc = $poe_irc->session_id(); -_log "session_id $irc"; - POE::Session->create( inline_states => { _start => sub { $_[KERNEL]->post( $irc => register => 'all' ); @@ -774,7 +771,6 @@ }, irc_255 => sub { # server is done blabbing $_[KERNEL]->post( $irc => join => $CHANNEL); - $_[KERNEL]->post( $irc => privmsg => 'nickserv', "IDENTIFY $NICK" ); }, irc_public => sub { my $kernel = $_[KERNEL];