about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-03-20 08:18:18 +0000
committerEric Wong <e@yhbt.net>2020-03-22 09:00:23 +0000
commit1218a4126807951a0f47286338dc04d7f197bb78 (patch)
tree5f97519d19a5fdfb92feecd8e64db43c036432d5 /lib/PublicInbox/V2Writable.pm
parentd34a4b80724e3f77a507ad08b91039427b0e09d5 (diff)
downloadpublic-inbox-1218a4126807951a0f47286338dc04d7f197bb78.tar.gz
We can pass blessed PublicInbox::Smsg objects to internal
indexing APIs instead of having long parameter lists in some
places.  The end goal is to avoid parsing redundant information
each step of the way and hopefully make things more
understandable.
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index d39a6f89..34dd139b 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -150,7 +150,13 @@ sub add {
 # indexes a message, returns true if checkpointing is needed
 sub do_idx ($$$$$$$) {
         my ($self, $msgref, $mime, $len, $num, $oid, $mid0) = @_;
-        $self->{over}->add_overview($mime, $len, $num, $oid, $mid0, $self);
+        my $smsg = bless {
+                bytes => $len,
+                num => $num,
+                blob => $oid,
+                mid => $mid0,
+        }, 'PublicInbox::Smsg';
+        $self->{over}->add_overview($mime, $smsg, $self);
         my $idx = idx_shard($self, $num % $self->{shards});
         $idx->index_raw($len, $msgref, $num, $oid, $mid0, $mime, $self);
         my $n = $self->{transact_bytes} += $len;