]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiRemote.pm
www_stream: extra link to mirroring information in the footer
[public-inbox.git] / lib / PublicInbox / LeiRemote.pm
index 945d9990a535e7bb4a6c2b6d41ce40f99055b583..580787c042c4e317d7c79ddab425c05b0816d2f3 100644 (file)
@@ -26,12 +26,13 @@ sub _each_mboxrd_eml { # callback for MboxReader->mboxrd
        my ($eml, $self) = @_;
        my $lei = $self->{lei};
        my $xoids = $lei->{ale}->xoids_for($eml, 1);
+       my $smsg = bless {}, 'PublicInbox::Smsg';
        if ($lei->{sto} && !$xoids) { # memoize locally
-               $lei->{sto}->ipc_do('add_eml', $eml);
+               my $res = $lei->{sto}->ipc_do('add_eml', $eml);
+               $smsg = $res if ref($res) eq ref($smsg);
        }
-       my $smsg = bless {}, 'PublicInbox::Smsg';
-       $smsg->{blob} = $xoids ? (keys(%$xoids))[0]
-                               : git_sha(1, $eml)->hexdigest;
+       $smsg->{blob} //= $xoids ? (keys(%$xoids))[0]
+                               : $lei->git_blob_id($eml);
        $smsg->populate($eml);
        $smsg->{mid} //= '(none)';
        push @{$self->{smsg}}, $smsg;