| 1 | # This code is part of Perl distribution Mail-Box-IMAP4 version 4.01. | ||||||||||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.05. | ||||||||||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | # This software is copyright (c) 2001-2025 by Mark Overmeer. | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | package Mail::Box::IMAP4::Head;{ | ||||||||||||||||||||||||||||
| 13 | 3 | our $VERSION = '4.01'; | |||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 3 | ▶ | use base 'Mail::Message::Head'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 3 | ▶ | use Log::Report 'mail-box-imap4', import => []; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | #-------------------- | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | sub init($$) | ||||||||||||||||||||||||||||
| 26 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
init: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 0 | $self->SUPER::init($args); | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | $self->{MBIH_c_fields} = $args->{cache_fields}; | |||||||||||||||||||||||||||
| 30 | 0 | $self; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | sub get($;$) | ||||||||||||||||||||||||||||
| 35 | 0 | ▶ | { my ($self, $name, $index) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get: not called CC=10 SCAR=47.0
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | if(not $self->{MBIH_c_fields}) { ; } | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 38 | elsif(wantarray) | ||||||||||||||||||||||||||||
| 39 | 0 | { my @values = $self->SUPER::get(@_); | |||||||||||||||||||||||||||
| 40 | 0 | ▶ | return @values if @values; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | else | ||||||||||||||||||||||||||||
| 43 | 0 | { my $value = $self->SUPER::get(@_); | |||||||||||||||||||||||||||
| 44 | 0 | ▶ | return $value if defined $value; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | # Something here, playing with ENVELOPE, may improve the performance | ||||||||||||||||||||||||||||
| 48 | # as well. | ||||||||||||||||||||||||||||
| 49 | 0 | my $imap = $self->message->folder->transporter; | |||||||||||||||||||||||||||
| 50 | 0 | my $uidl = $self->message->unique; | |||||||||||||||||||||||||||
| 51 | 0 | my @fields = $imap->getFields($uidl, $name); | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 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"}
| |||||||||||||||||||||||||||||
| 54 | 0 | { $self->addNoRealize($_) for @fields | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | ▶ | defined $index ? $fields[$index] : wantarray ? @fields : $fields[0]; | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | sub guessBodySize() {undef} | ||||||||||||||||||||||||||||
| 61 | sub guessTimestamp() {undef} | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | #-------------------- | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 3 | 1; | |||||||||||||||||||||||||||