about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchMsg.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-23 20:29:24 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-27 02:34:20 +0000
commit007cb8774e7013e2aaca32003bbd1653e3d8582f (patch)
tree24645e152f6c386730dfdc9925b5dd5ca7740752 /lib/PublicInbox/SearchMsg.pm
parent26895bbd94dc93b76274652f9ea35626fd63a5fa (diff)
downloadpublic-inbox-007cb8774e7013e2aaca32003bbd1653e3d8582f.tar.gz
This needs tests and further refinement, but current tests pass.
Diffstat (limited to 'lib/PublicInbox/SearchMsg.pm')
-rw-r--r--lib/PublicInbox/SearchMsg.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm
index dd3d58d0..b944868f 100644
--- a/lib/PublicInbox/SearchMsg.pm
+++ b/lib/PublicInbox/SearchMsg.pm
@@ -24,6 +24,13 @@ sub wrap {
         bless { doc => $doc, mime => undef, mid => $mid }, $class;
 }
 
+sub get {
+        my ($class, $head, $db, $mid) = @_;
+        my $doc_id = $head->get_docid;
+        my $doc = $db->get_document($doc_id);
+        load_expand(wrap($class, $doc, $mid))
+}
+
 sub get_val ($$) {
         my ($doc, $col) = @_;
         Search::Xapian::sortable_unserialise($doc->get_value($col));