| 1 | # Copyrights 2001-2019 by [Mark Overmeer]. | ||||||||||||||||||||||||||||
| 2 | # For other contributors see ChangeLog. | ||||||||||||||||||||||||||||
| 3 | # See the manual pages for details on the licensing terms. | ||||||||||||||||||||||||||||
| 4 | # Pod stripped from pm file by OODoc 2.02. | ||||||||||||||||||||||||||||
| 5 | # This code is part of distribution Mail-Box-IMAP4. Meta-POD processed with | ||||||||||||||||||||||||||||
| 6 | # OODoc into POD and HTML manual-pages. See README.md | ||||||||||||||||||||||||||||
| 7 | # Copyright Mark Overmeer. Licensed under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | package Mail::Box::IMAP4::Head; | ||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 2 | $VERSION = '3.007'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 2 | ▶ | use base 'Mail::Message::Head'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 2 | ▶ | use Date::Parse; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | sub init($$) | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | 0 | $self->SUPER::init($args); | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 0 | $self->{MBIH_c_fields} = $args->{cache_fields}; | |||||||||||||||||||||||||||
| 26 | 0 | $self; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | sub get($;$) | ||||||||||||||||||||||||||||
| 31 | 0 | ▶ | { my ($self, $name, $index) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get: not called CC=10 SCAR=47.0
Pod
documented
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | if(not $self->{MBIH_c_fields}) { ; } | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 34 | elsif(wantarray) | ||||||||||||||||||||||||||||
| 35 | 0 | { my @values = $self->SUPER::get(@_); | |||||||||||||||||||||||||||
| 36 | 0 | ▶ | return @values if @values; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | else | ||||||||||||||||||||||||||||
| 39 | 0 | { my $value = $self->SUPER::get(@_); | |||||||||||||||||||||||||||
| 40 | 0 | ▶ | return $value if defined $value; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | # Something here, playing with ENVELOPE, may improve the performance | ||||||||||||||||||||||||||||
| 44 | # as well. | ||||||||||||||||||||||||||||
| 45 | 0 | my $imap = $self->message->folder->transporter; | |||||||||||||||||||||||||||
| 46 | 0 | my $uidl = $self->message->unique; | |||||||||||||||||||||||||||
| 47 | 0 | my @fields = $imap->getFields($uidl, $name); | |||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if(@fields && $self->{MBIH_c_fields}) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@fields and $self->{"MBIH_c_fields"}
MC/DC0%0/2
@fields and $self->{"MBIH_c_fields"}
@fields
$self->{"MBIH_c_fields"}
Truth table0%0/3
A and B
A= @fieldsB= $self->{"MBIH_c_fields"}
| |||||||||||||||||||||||||||||
| 50 | 0 | { $self->addNoRealize($_) for @fields | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | ▶ | defined $index ? $fields[$index] | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 54 | : wantarray ? @fields | ||||||||||||||||||||||||||||
| 55 | : $fields[0]; | ||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | sub guessBodySize() {undef} | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | sub guessTimestamp() {undef} | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | #------------------------------------------ | ||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 2 | 1; | |||||||||||||||||||||||||||