user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 0/5] no trash, glossary doc
@ 2021-03-10 13:23  7% Eric Wong
  2021-03-10 13:23  6% ` [PATCH 3/5] lei import: simplify Maildir handling Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-03-10 13:23 UTC (permalink / raw)
  To: meta

-watch on IMAP now matches Maildir behavior in skipping
trashed (deleted) and draft messages.

"lei import" now ignores (trashed|deleted) messages, as well;
but imports drafts.

The glossary is intended to help reduce confusion as more
things overlap with different terminology.

Eric Wong (5):
  doc: technical/data_structures: update for EOFpipe
  watch: IMAP: ignore \Deleted and \Draft messages
  lei import: simplify Maildir handling
  lei import: skip trashed Maildir messages
  doc: start glossary for overlapping concepts

 Documentation/public-inbox-glossary.pod     | 95 +++++++++++++++++++++
 Documentation/technical/data_structures.txt | 10 +--
 Documentation/txt2pre                       |  1 +
 MANIFEST                                    |  1 +
 Makefile.PL                                 |  3 +-
 lib/PublicInbox/LeiImport.pm                |  8 +-
 lib/PublicInbox/LeiStore.pm                 |  6 --
 lib/PublicInbox/MdirReader.pm               |  1 +
 lib/PublicInbox/NetReader.pm                |  2 +
 lib/PublicInbox/Watch.pm                    | 26 +-----
 t/lei-import-maildir.t                      |  7 ++
 xt/net_writer-imap.t                        | 44 ++++++++++
 12 files changed, 165 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/public-inbox-glossary.pod

^ permalink raw reply	[relevance 7%]

* [PATCH 3/5] lei import: simplify Maildir handling
  2021-03-10 13:23  7% [PATCH 0/5] no trash, glossary doc Eric Wong
@ 2021-03-10 13:23  6% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-03-10 13:23 UTC (permalink / raw)
  To: meta

Having a one-off Maildir functionality in LeiStore doesn't seem
worth the maintenance burden, especially given an upcoming
change to skip trashed messages.

I expect this will hurt performance slightly with extra IPC
overhead for the socket copy, but "lei import" may eventually
become rare or at least not hit messages redundantly.
---
 lib/PublicInbox/LeiImport.pm | 8 ++++----
 lib/PublicInbox/LeiStore.pm  | 6 ------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm
index 23cecd53..815788b3 100644
--- a/lib/PublicInbox/LeiImport.pm
+++ b/lib/PublicInbox/LeiImport.pm
@@ -147,9 +147,9 @@ error reading $input: $!
 	$lei->child_error(1 << 8, "$input: $@") if $@;
 }
 
-sub _import_maildir { # maildir_each_file cb
-	my ($f, $sto, $set_kw) = @_;
-	$sto->ipc_do('set_eml_from_maildir', $f, $set_kw);
+sub _import_maildir { # maildir_each_eml cb
+	my ($f, $kw, $eml, $sto, $set_kw) = @_;
+	$sto->ipc_do('set_eml', $eml, $set_kw ? @$kw : ());
 }
 
 sub _import_net { # imap_each, nntp_each cb
@@ -181,7 +181,7 @@ sub import_path_url {
 		return $lei->fail(<<EOM) if $ifmt && $ifmt ne 'maildir';
 $input appears to a be a maildir, not $ifmt
 EOM
-		PublicInbox::MdirReader::maildir_each_file($input,
+		PublicInbox::MdirReader::maildir_each_eml($input,
 					\&_import_maildir,
 					$lei->{sto}, $lei->{opt}->{kw});
 	} else {
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index 92c29100..6ace2ad1 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -213,12 +213,6 @@ sub set_eml {
 	add_eml($self, $eml, @kw) // set_eml_keywords($self, $eml, @kw);
 }
 
-sub set_eml_from_maildir {
-	my ($self, $f, $set_kw) = @_;
-	my $eml = eml_from_path($f) or return;
-	set_eml($self, $eml, $set_kw ? maildir_keywords($f) : ());
-}
-
 sub checkpoint {
 	my ($self, $wait) = @_;
 	if (my $im = $self->{im}) {

^ permalink raw reply related	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-03-10 13:23  7% [PATCH 0/5] no trash, glossary doc Eric Wong
2021-03-10 13:23  6% ` [PATCH 3/5] lei import: simplify Maildir handling Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).