about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-01 10:06:45 +0000
committerEric Wong <e@yhbt.net>2020-06-03 04:04:21 +0000
commit30ac717281ae224a9c117361ca941818adc69cf3 (patch)
treea9af6d0092c7fea1ba7b55951e6fe82e853b1732 /lib/PublicInbox/Inbox.pm
parent01574fe596bceae54f8ead45991b9ac4fe35ea10 (diff)
downloadpublic-inbox-30ac717281ae224a9c117361ca941818adc69cf3.tar.gz
The goal of this is to eventually remove the $smsg->{mime} field
which is easy-to-misuse and cause memory explosions which
necessitated fixes like commit 7d02b9e64455831d
("view: stop storing all MIME objects on large threads").
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index c295b267..bd1489e3 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -334,6 +334,12 @@ sub smsg_mime {
         }
 }
 
+sub smsg_eml {
+        my ($self, $smsg) = @_;
+        my $bref = msg_by_smsg($self, $smsg) or return;
+        PublicInbox::Eml->new($bref);
+}
+
 sub mid2num($$) {
         my ($self, $mid) = @_;
         my $mm = mm($self) or return;