about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-05-19 00:31:50 +0000
committerEric Wong <e@80x24.org>2016-05-19 19:24:21 +0000
commit21a5cfeb30afef90ca888d425b62651466eed9e3 (patch)
treea39f11d0538cada517b8dd0bc3696328c6cf2e4e /lib/PublicInbox/SearchIdx.pm
parent4f7977b42aab1595b3a45b41e19499b38c46c8cc (diff)
downloadpublic-inbox-21a5cfeb30afef90ca888d425b62651466eed9e3.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm6
1 files changed, 3 insertions, 3 deletions
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...