File Coverage

blib/lib/Siesta/Plugin/Debounce.pm
Criterion Covered Total %
statement 16 18 88.8
branch 0 2 0.0
condition n/a
subroutine 5 5 100.0
pod 1 2 50.0
total 22 27 81.4


line stmt bran cond sub pod time code
1             package Siesta::Plugin::Debounce;
2 3     3   2063 use strict;
  3         9  
  3         106  
3 3     3   15 use Siesta::Plugin;
  3         9  
  3         22  
4 3     3   76 use base 'Siesta::Plugin';
  3         5  
  3         570  
5              
6             sub description {
7 1     1 0 477 "handles bounces/loops.";
8             }
9              
10             sub process {
11 1     1 1 1 my $self = shift;
12 1         3 my $mail = shift;
13              
14 1         9 my $post = $self->list->post_address;
15 1         100 for my $been ( $mail->header_set('X-Been-There') ) {
16 0         0 chomp $been;
17              
18             # have we been here before?
19 0 0       0 return 1 if $been eq $post;
20             }
21              
22 1         34 $mail->header_set( 'X-Been-There', $post );
23 1         39 return;
24             }
25              
26             1;
27