about summary refs log tree commit homepage
path: root/lib/PublicInbox/Smsg.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-01 10:06:52 +0000
committerEric Wong <e@yhbt.net>2020-06-03 04:04:21 +0000
commit7e782e8ff3ec64500913069a2efb5815fe711a36 (patch)
tree52ac6cf6ac5a8bbfae97ffd6cae2f160e4ee22d4 /lib/PublicInbox/Smsg.pm
parentd32333a12ca46861fab82640c3697fdbca879bd2 (diff)
downloadpublic-inbox-7e782e8ff3ec64500913069a2efb5815fe711a36.tar.gz
To further simplify callers and avoid embarrasing memory
explosions[1], we can finally eliminate this method in
favor of smsg_eml.

[1] commit 7d02b9e64455831d3bda20cd2e64e0c15dc07df5
    ("view: stop storing all MIME objects on large threads")
    fixed a huge memory blowup.
Diffstat (limited to 'lib/PublicInbox/Smsg.pm')
-rw-r--r--lib/PublicInbox/Smsg.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm
index 446bca81..9688c559 100644
--- a/lib/PublicInbox/Smsg.pm
+++ b/lib/PublicInbox/Smsg.pm
@@ -12,7 +12,7 @@ use strict;
 use warnings;
 use base qw(Exporter);
 our @EXPORT_OK = qw(subject_normalized);
-use PublicInbox::MID qw/mid_mime/;
+use PublicInbox::MID qw(mid_mime mids);
 use PublicInbox::Address;
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
 use Time::Local qw(timegm);
@@ -105,7 +105,7 @@ sub __hdr ($$) {
         };
 }
 
-# for Import and v1 WWW code paths
+# for Import and v1 non-SQLite WWW code paths
 sub populate {
         my ($self, $hdr, $v2w) = @_;
         for my $f (qw(From To Cc Subject)) {
@@ -133,6 +133,9 @@ sub populate {
         $self->{-ts} = [ my @ts = msg_timestamp($hdr, $v2w->{cotime}) ];
         $self->{ds} //= $ds[0]; # no zone
         $self->{ts} //= $ts[0];
+
+        # for v1 users w/o SQLite
+        $self->{mid} //= eval { mids($hdr)->[0] } // '';
 }
 
 sub subject ($) { __hdr($_[0], 'Subject') }