| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# This code is part of Perl distribution HTML-FromMail version 4.00. |
|
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) 2003-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 HTML::FromMail::Head;{ |
|
13
|
|
|
|
|
|
|
our $VERSION = '4.00'; |
|
14
|
|
|
|
|
|
|
} |
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
2138
|
use base 'HTML::FromMail::Page'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
710
|
|
|
17
|
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
9
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
30
|
|
|
19
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
55
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
6
|
use Log::Report 'html-frommail'; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
4
|
|
|
22
|
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
1134
|
use HTML::FromMail::Field (); |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
475
|
|
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#-------------------- |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub init($) |
|
28
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
|
29
|
0
|
|
0
|
|
|
|
$args->{topic} ||= 'head'; |
|
30
|
0
|
|
|
|
|
|
$self->SUPER::init($args); |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#----------- |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
#----------- |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub fields($$) |
|
38
|
0
|
|
|
0
|
1
|
|
{ my ($thing, $realhead, $args) = @_; |
|
39
|
0
|
|
|
|
|
|
my $head = $realhead->clone; # we are probably going to remove lines |
|
40
|
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my $lg = $args->{remove_list_group}; |
|
42
|
0
|
0
|
0
|
|
|
|
$head->removeListGroup if $lg || !defined $lg; |
|
43
|
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $sg = $args->{remove_spam_groups}; |
|
45
|
0
|
0
|
0
|
|
|
|
$head->removeSpamGroups if $sg || !defined $sg; |
|
46
|
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
my $rg = $args->{remove_resent_groups}; |
|
48
|
0
|
0
|
0
|
|
|
|
$head->removeResentGroups if $rg || !defined $rg; |
|
49
|
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my @fields; |
|
51
|
0
|
0
|
|
|
|
|
if(my $select = $args->{select}) |
|
|
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
{ my @select = split /\|/, $select; |
|
53
|
0
|
|
|
|
|
|
@fields = map $head->grepNames($_), @select; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
elsif(my $ignore = $args->{ignore}) |
|
56
|
0
|
|
|
|
|
|
{ my @ignore = split /\|/, $ignore; |
|
57
|
0
|
|
|
|
|
|
local $" = ")|(?:"; |
|
58
|
0
|
|
|
|
|
|
my $skip = qr/^(?:@ignore)/i; |
|
59
|
0
|
|
|
|
|
|
@fields = grep $_->name !~ $skip, $head->orderedFields; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
else |
|
62
|
0
|
|
|
|
|
|
{ @fields = $head->orderedFields; |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
map $_->study, @fields; |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |