X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FMbox.pm;h=4f632d63558935c62b5e0af1ea882c81e39768a0;hb=87678710135973f72722258e171fc00f85c86ec8;hp=1f9ac6ec88cfd1a0989a0da5f7d44ab8590230cd;hpb=f2364c5765f0692d2f1e82b61804359a38f3fdfc;p=public-inbox.git diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 1f9ac6ec..4f632d63 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2019 all contributors +# Copyright (C) 2015-2020 all contributors # License: AGPL-3.0+ # Streaming (via getline) interface for formatting messages as an mboxrd. @@ -12,7 +12,7 @@ use strict; use warnings; use PublicInbox::MID qw/mid_escape/; use PublicInbox::Hval qw/to_filename/; -use PublicInbox::SearchMsg; +use PublicInbox::Smsg; use Email::Simple; use Email::MIME::Encode; @@ -24,11 +24,10 @@ sub subject_fn ($) { # no need for full Email::MIME, here if ($fn =~ /=\?/) { eval { $fn = Encode::decode('MIME-Header', $fn) }; - $fn = 'no-subject' if $@; + return 'no-subject' if $@; } $fn =~ s/^re:\s+//i; - $fn = to_filename($fn); - $fn eq '' ? 'no-subject' : $fn; + $fn eq '' ? 'no-subject' : to_filename($fn); } sub mb_stream { @@ -205,7 +204,7 @@ sub results_cb { my $srch = $ctx->{srch}; while (1) { while (my $mi = (($mset->items)[$ctx->{iter}++])) { - my $smsg = PublicInbox::SearchMsg::from_mitem($mi, + my $smsg = PublicInbox::Smsg::from_mitem($mi, $srch) or next; return $smsg; }