From 21a5cfeb30afef90ca888d425b62651466eed9e3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 19 May 2016 00:31:50 +0000 Subject: switch read-only uses of walk_parts to msg_iter msg_iter lets us know the index of the attachment, allow us to make more sensible labels and in a future commit, hyperlinks to download attachments. --- lib/PublicInbox/SearchIdx.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/SearchIdx.pm') diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 63be6810..9192bb07 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -11,6 +11,7 @@ use strict; use warnings; use base qw(PublicInbox::Search); use PublicInbox::MID qw/mid_clean id_compress mid_mime/; +use PublicInbox::MsgIter; require PublicInbox::Git; *xpfx = *PublicInbox::Search::xpfx; @@ -114,9 +115,8 @@ sub add_message { $tg->index_text($smsg->from); $tg->increase_termpos; - $mime->walk_parts(sub { - my ($part) = @_; - return if $part->subparts; # walk_parts already recurses + msg_iter($mime, sub { + my ($part, $depth, @idx) = @{$_[0]}; my $ct = $part->content_type || $ct_msg; # account for filter bugs... -- cgit v1.2.3-24-ge0c7