use PublicInbox::MID qw(mids);
use PublicInbox::NetReader qw(imap_uri nntp_uri);
+sub _json_prep ($) {
+ my ($smsg) = @_;
+ $smsg->{$_} += 0 for qw(bytes lines); # integerize
+ +{ %$smsg } # unbless and scalarize
+}
+
sub inspect_blob ($$) {
my ($lei, $oidhex) = @_;
my $ent = {};
}
if ($ibx && $ibx->over) {
my $smsg = $ibx->over->get_art($num);
- $ent->{smsg} = { %$smsg } if $smsg;
+ $ent->{smsg} = _json_prep($smsg) if $smsg;
}
defined($docid) ? inspect_docid($lei, $docid, $ent) : $ent;
}
if ($ibx && $ibx->over) {
my ($id, $prev);
while (my $smsg = $ibx->over->next_by_mid($mid, \$id, \$prev)) {
- push @{$ent->{smsg}}, { %$smsg }
+ push @{$ent->{smsg}}, _json_prep($smsg);
}
}
$ent;
}
sub _complete_inspect {
- my ($lei, @argv) = @_;
- my $lms = $lei->lms or return;
- my $match_cb = $lei->complete_url_prepare(\@argv);
- map { $match_cb->($_) } $lms->folders;
+ require PublicInbox::LeiRefreshMailSync;
+ PublicInbox::LeiRefreshMailSync::_complete_refresh_mail_sync(@_);
+ # TODO: message-ids?, blobs? could get expensive...
}
1;