Changeset 138

Show
Ignore:
Timestamp:
02/24/06 16:34:45
Author:
miyagawa
Message:
  • Fixes SmartFeed? duplicate entries bug. Fixes #61
  • Support CTCP ACTION (/me blah blah) in Publish::IRC
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/bin/plagger-ircbot.pl

    r104 r138  
    7272    my ( $kernel, $heap, $msg ) = @_[ KERNEL, HEAP, ARG0 ]; 
    7373    eval { 
    74         $kernel->post( bot => notice => $_, $msg ) 
    75             for @{ $config->{server_channels} } 
     74        for my $channel (@{ $config->{server_channels} }) { 
     75            if ($config->{announce} =~ /action/i) { 
     76                $kernel->post( bot => ctcp => $channel, "ACTION $msg"); 
     77            } else { 
     78                $kernel->post( bot => notice => $channel, $msg ) 
     79            } 
     80        } 
    7681    }; 
    7782    err "update error: $@" if $@; 
  • trunk/plagger/lib/Plagger.pm

    r137 r138  
    158158        } 
    159159    } 
     160    $self->run_hook('smartfeed.finalize'); 
    160161 
    161162    $self->run_hook('publish.init'); 
  • trunk/plagger/lib/Plagger/Plugin/Publish/IRC.pm

    r104 r138  
    3131    $context->log(info => "Notifying " . $args->{feed}->title . " to IRC"); 
    3232 
    33     my $feed = $args->{feed}; 
    34     my $body = $self->templatize($context, $feed); 
     33    my $body = $self->templatize($context, $args->{feed}); 
    3534    Encode::_utf8_off($body) if Encode::is_utf8($body); 
    3635    Encode::from_to($body, 'utf-8', $self->conf->{charset}) 
     
    6968        - #plagger-test 
    7069      charset: iso-2022-jp 
     70      announce: notice 
    7171 
    7272=head1 DESCRIPTION 
  • trunk/plagger/lib/Plagger/Plugin/SmartFeed.pm

    r93 r138  
    1313        'smartfeed.init'  => \&feed_init, 
    1414        'smartfeed.entry' => \&feed_entry, 
     15        'smartfeed.finalize' => \&feed_finalize, 
    1516    ); 
    1617} 
     
    2425    $feed->title( $self->conf->{title} || "Entries " . $self->rule->as_title ); 
    2526 
    26     $context->update->add($feed); 
    27  
    2827    $self->{feed} = $feed; 
    2928} 
     
    3433} 
    3534 
     35sub feed_finalize { 
     36    my($self, $context, $args) = @_; 
     37    $context->update->add($self->{feed}) if $self->{feed}->count; 
     38} 
     39 
    36401;