diff options
author | Eric Wong <e@yhbt.net> | 2020-03-20 08:18:18 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-03-22 09:00:23 +0000 |
commit | 1218a4126807951a0f47286338dc04d7f197bb78 (patch) | |
tree | 5f97519d19a5fdfb92feecd8e64db43c036432d5 /lib/PublicInbox/OverIdx.pm | |
parent | d34a4b80724e3f77a507ad08b91039427b0e09d5 (diff) | |
download | public-inbox-1218a4126807951a0f47286338dc04d7f197bb78.tar.gz |
We can pass blessed PublicInbox::Smsg objects to internal indexing APIs instead of having long parameter lists in some places. The end goal is to avoid parsing redundant information each step of the way and hopefully make things more understandable.
Diffstat (limited to 'lib/PublicInbox/OverIdx.pm')
-rw-r--r-- | lib/PublicInbox/OverIdx.pm | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/PublicInbox/OverIdx.pm b/lib/PublicInbox/OverIdx.pm index f49dfa00..2d71956d 100644 --- a/lib/PublicInbox/OverIdx.pm +++ b/lib/PublicInbox/OverIdx.pm @@ -245,15 +245,9 @@ sub subject_path ($) { } sub add_overview { - my ($self, $mime, $bytes, $num, $oid, $mid0, $times) = @_; - my $lines = $mime->body_raw =~ tr!\n!\n!; - my $smsg = bless { - mime => $mime, - mid => $mid0, - bytes => $bytes, - lines => $lines, - blob => $oid, - }, 'PublicInbox::Smsg'; + my ($self, $mime, $smsg, $times) = @_; + $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); @@ -268,7 +262,7 @@ sub add_overview { $dd = compress($dd); my $ds = msg_timestamp($hdr, $times->{autime}); my $ts = msg_datestamp($hdr, $times->{cotime}); - my $values = [ $ts, $ds, $num, $mids, $refs, $xpath, $dd ]; + my $values = [ $ts, $ds, $smsg->{num}, $mids, $refs, $xpath, $dd ]; add_over($self, $values); } |