]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_store: remove maildir_keywords
authorEric Wong <e@80x24.org>
Tue, 16 Mar 2021 01:43:45 +0000 (07:43 +0600)
committerEric Wong <e@80x24.org>
Tue, 16 Mar 2021 10:32:07 +0000 (06:32 -0400)
It's redundant and the same functionality is in MdirReader.

lib/PublicInbox/LeiStore.pm
t/lei_store.t

index 10fa9c5489f62d999cd064f918eb0318d0cb83db..771443dbdfe5ff51afe305c0299ef0581bf3b719 100644 (file)
@@ -159,14 +159,6 @@ sub remove_eml_keywords {
        \@docids;
 }
 
-# TODO: move this to MdirReader, maybe...
-# cf: https://cr.yp.to/proto/maildir.html
-my %c2kw = ('D' => 'draft', F => 'flagged', R => 'answered', S => 'seen');
-sub maildir_keywords {
-       $_[-1] =~ /:2,([A-Z]+)\z/i ?
-               sort(map { $c2kw{$_} // () } split(//, $1)) : ();
-}
-
 sub add_eml {
        my ($self, $eml, @kw) = @_;
        my $im = $self->importer; # may create new epoch
index 258db25a8171f7d9a6a7c7b550fe3f781238cb55..d270e1f6d6d3ec0d5db5658295e549e7b446a0be 100644 (file)
@@ -21,12 +21,6 @@ like($smsg->{blob}, qr/\A[0-9a-f]+\z/, 'add returned OID');
 my $eml = eml_load('t/data/0001.patch');
 is($sto->add_eml($eml), undef, 'idempotent');
 $sto->done;
-is_deeply([$sto->maildir_keywords('/foo:2,')], [], 'Maildir no keywords');
-is_deeply([$sto->maildir_keywords('/foo:2,S')], ['seen'], 'Maildir seen');
-is_deeply([$sto->maildir_keywords('/foo:2,RS')], ['answered', 'seen'],
-       'Maildir answered + seen');
-is_deeply([$sto->maildir_keywords('/foo:2,RSZ')], ['answered', 'seen'],
-       'Maildir answered + seen w/o Z');
 {
        my $es = $sto->search;
        my $msgs = $es->over->query_xover(0, 1000);