diff options
author | Eric Wong <e@yhbt.net> | 2020-06-01 10:06:54 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-06-03 04:04:21 +0000 |
commit | 4723390cc4bb76762a9d60feecb66482caaef6a7 (patch) | |
tree | a5216e97ff0e767ac758ddd865aeae8d0fb9d499 /lib/PublicInbox | |
parent | 49ce43454cce10505d6aeea14521c03e6224a745 (diff) | |
download | public-inbox-4723390cc4bb76762a9d60feecb66482caaef6a7.tar.gz |
We'll let $smsg->populate take care of everything all at once without hanging onto the header object for too long.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/OverIdx.pm | 1 | ||||
-rw-r--r-- | lib/PublicInbox/Smsg.pm | 33 |
2 files changed, 3 insertions, 31 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index cb15baad..a078f804 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -254,7 +254,6 @@ sub subject_path ($) { sub add_overview { my ($self, $mime, $smsg) = @_; $smsg->{lines} = $mime->body_raw =~ tr!\n!\n!; - $smsg->{mime} = $mime; # XXX temporary? my $hdr = $mime->header_obj; my $mids = mids_for_index($hdr); my $refs = parse_references($smsg, $hdr, $mids); diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm index 9688c559..9e363a11 100644 --- a/lib/PublicInbox/Smsg.pm +++ b/lib/PublicInbox/Smsg.pm @@ -12,7 +12,7 @@ use strict; use warnings; use base qw(Exporter); our @EXPORT_OK = qw(subject_normalized); -use PublicInbox::MID qw(mid_mime mids); +use PublicInbox::MID qw(mids); use PublicInbox::Address; use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp); use Time::Local qw(timegm); @@ -96,13 +96,7 @@ sub lines ($) { $_[0]->{lines} } sub __hdr ($$) { my ($self, $field) = @_; - $self->{lc($field)} //= do { - my $mime = $self->{mime} or return; - my $val = join(', ', $mime->header($field)); - $val =~ tr/\r//d; - $val =~ tr/\t\n/ /; - $val; - }; + $self->{lc($field)}; } # for Import and v1 non-SQLite WWW code paths @@ -174,34 +168,13 @@ sub from_name { $self->{from_name}; } -sub ts { - my ($self) = @_; - $self->{ts} ||= eval { msg_timestamp($self->{mime}->header_obj) } || 0; -} - -sub ds { - my ($self) = @_; - $self->{ds} ||= eval { msg_datestamp($self->{mime}->header_obj); } || 0; -} - sub references { my ($self) = @_; my $x = $self->{references}; defined $x ? $x : ''; } -sub mid ($;$) { - my ($self, $mid) = @_; - - if (defined $mid) { - $self->{mid} = $mid; - } elsif (defined(my $rv = $self->{mid})) { - $rv; - } else { - die "NO {mime} for mid\n" unless $self->{mime}; - mid_mime($self->{mime}) # v1 w/o Xapian - } -} +sub mid { $_[0]->{mid} } our $REPLY_RE = qr/^re:\s+/i; |