From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/2] lei_store: remove maildir_keywords
Date: Tue, 16 Mar 2021 07:43:45 +0600 [thread overview]
Message-ID: <20210316014345.24569-3-e@80x24.org> (raw)
In-Reply-To: <20210316014345.24569-1-e@80x24.org>
It's redundant and the same functionality is in MdirReader.
---
lib/PublicInbox/LeiStore.pm | 8 --------
t/lei_store.t | 6 ------
2 files changed, 14 deletions(-)
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index 10fa9c54..771443db 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -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
diff --git a/t/lei_store.t b/t/lei_store.t
index 258db25a..d270e1f6 100644
--- a/t/lei_store.t
+++ b/t/lei_store.t
@@ -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);
prev parent reply other threads:[~2021-03-16 1:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 1:43 [PATCH 0/2] keyword handling cleanups Eric Wong
2021-03-16 1:43 ` [PATCH 1/2] mbox: move mbox_keywords to MboxReader Eric Wong
2021-03-16 1:43 ` Eric Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210316014345.24569-3-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).