| Mail-Summary-Tools documentation | Contained in the Mail-Summary-Tools distribution. |
Mail::Summary::Tools::ThreadFilter - Filter Mail::Box::Thread::Node objects
# don't use it directly
This is just a utility class used by the summary creation code, to limit the scope of the summary.
| Mail-Summary-Tools documentation | Contained in the Mail-Summary-Tools distribution. |
#!/usr/bin/perl package Mail::Summary::Tools::ThreadFilter; use Moose; has filters => ( isa => "ArrayRef", is => "rw", required => 1, auto_deref => 1, ); sub filter { my ( $self, %params ) = @_; my $threads = $params{threads} || die "no threads";; my $cb = $params{callback} || die "no callback"; thread: foreach my $thread ( $threads->sortedAll ) { foreach my $filter ( $self->filters ) { next thread unless $filter->( $thread ); } $cb->($thread); } } __PACKAGE__; __END__