Changeset 275

Show
Ignore:
Timestamp:
03/04/06 18:10:48
Author:
tokuhirom
Message:

change 1feed/connection to 1feed/mail

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/CustomFeed/POP3.pm

    r255 r275  
    3838    $context->log(info => "Login to pop3 server($host) succeeded."); 
    3939 
    40     my $feed = Plagger::Feed->new; 
    41     $feed->type('pop3'); 
    42     $feed->title("POP3: $host"); 
    43  
    4440    my $msgnums = $pop->list; 
    4541    for my $msgnum (keys %$msgnums) { 
     
    4743 
    4844        my $msg = $pop->get($msgnum); 
    49         my $entry = $self->mail2entry(join '', @$msg); 
    50         $feed->add_entry($entry); 
     45        my $feed = $self->mail2feed(join '', @$msg); 
     46        $context->update->add($feed); 
    5147 
    5248        if ($self->conf->{delete}) { 
     
    5753 
    5854    $pop->quit; 
    59  
    60     $context->update->add($feed); 
    6155} 
    6256 
    63 sub mail2entry
     57sub mail2feed
    6458    my ($self, $message) = @_; 
    6559 
     
    6862    my $format = DateTime::Format::Mail->new->loose; 
    6963 
     64    my $feed = Plagger::Feed->new; 
     65    $feed->type('pop3'); 
     66    $feed->title($email->header('Subject')); 
     67 
    7068    $entry->title($email->header('Subject')); 
    7169    $entry->author($email->header('From')); 
     
    7371    $entry->body($self->get_body($email)); 
    7472 
    75     return $entry; 
     73    $feed->add_entry($entry); 
     74 
     75    return $feed; 
    7676} 
    7777