]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Inbox.pm
view: depend on SearchMsg for Message-ID
[public-inbox.git] / lib / PublicInbox / Inbox.pm
index 666c81d7125cc68e7166e1249edcb2fec0376bdf..b1ea8dc7bce215b06fe3f7a4715d53f7846c3b84 100644 (file)
@@ -8,6 +8,7 @@ use warnings;
 use PublicInbox::Git;
 use PublicInbox::MID qw(mid2path);
 use Devel::Peek qw(SvREFCNT);
+use PublicInbox::MIME;
 
 my $cleanup_timer;
 eval {
@@ -246,6 +247,14 @@ sub msg_by_smsg ($$;$) {
        $str;
 }
 
+sub smsg_mime {
+       my ($self, $smsg, $ref) = @_;
+       if (my $s = msg_by_smsg($self, $smsg, $ref)) {
+               $smsg->{mime} = PublicInbox::MIME->new($s);
+               return $smsg;
+       }
+}
+
 sub path_check {
        my ($self, $path) = @_;
        git($self)->check('HEAD:'.$path);