-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Each instance of this represents an IMAP client connected to
$self->{ibx} = $ibx;
$self->{uo2m} = uo2m_ary_new($self, \$exists);
} else {
- $exists = $over->imap_exists;
+ my $uid_end = $uid_base + UID_SLICE;
+ $exists = $over->imap_exists($uid_base, $uid_end);
}
ensure_slices_exist($self->{imapd}, $ibx, $over->max);
} else {
# prepares an index for BODY[$SECTION_IDX] fetches
sub eml_body_idx ($$) {
my ($eml, $section_idx) = @_;
- my $idx = $eml->{imap_all_parts} //= do {
+ my $idx = $eml->{imap_all_parts} // do {
my $all = {};
$eml->each_part(\&eml_index_offs_i, $all, 0, 1);
# top-level of multipart, BODY[0] not allowed (nz-number)
delete $all->{0};
- $all;
+ $eml->{imap_all_parts} = $all;
};
$idx->{$section_idx};
}
search_common($self, $tag, $query, 1);
}
-sub args_ok ($$) { # duplicated from PublicInbox::NNTP
- my ($cb, $argc) = @_;
- my $tot = prototype $cb;
- my ($nreq, undef) = split(';', $tot);
- $nreq = ($nreq =~ tr/$//) - 1;
- $tot = ($tot =~ tr/$//) - 1;
- ($argc <= $tot && $argc >= $nreq);
-}
-
# returns 1 if we can continue, 0 if not due to buffered writes or disconnect
sub process_line ($$) {
my ($self, $l) = @_;