1 # Copyright (C) 2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # "lei forget-mail-sync" drop synchronization information
5 # TODO: figure out what to do about "lei index" users having
6 # dangling references. Perhaps just documenting "lei index"
7 # use being incompatible with "forget-mail-sync" use is
10 package PublicInbox::LeiForgetMailSync;
13 use PublicInbox::LeiExportKw;
15 sub lei_forget_mail_sync {
16 my ($lei, @folders) = @_;
17 my $sto = $lei->_lei_store or return;
18 my $lms = $sto->search->lms or return;
19 my $err = $lms->arg2folder($lei, \@folders);
20 $lei->qerr(@{$err->{qerr}}) if $err->{qerr};
21 return $lei->fail($err->{fail}) if $err->{fail};
24 $lms->forget_folder($_) for @folders;
28 *_complete_forget_mail_sync = \&PublicInbox::LeiExportKw::_complete_export_kw;